Related Documents
Document Properties
KbidK27956
Last Modified26-Nov-2018
Added to KB01-Aug-2016
Public AccessEveryone
StatusOnline
Doc TypeReferences
Product
  • ICM 7.8
  • ICM 7.9
  • ICM 7.10

REST API - Get personalized list of products


Note

Starting with 7.10 our REST API is documented using Swagger notation accessible at developer.cloud.intershop.com.

URI

/products;spgid=<personalization_group_id>

Http Method

GET

Short Description

Get a list of products. If page cache is enabled and spgid parameter is provided with a valid personalization group ID - the Web Adapter caches this user specific response.

Query Parameters

For available parameters refer to:

Example Requests

/products;spgid=gGqKDaxstt0000whc8sEo8Fd0000,

/products;spgid=gGqKDaxstt0000whc8sEo8Fd0000?amount=2&offset=2

HTTP Status Codes

200 OK

404 Not found

Description

Equivalent to /products but in addition "spgid" matrix parameter is provided and used for personalized caching. See REST API - Get list of products (until 7.8), REST API - Get list of products with pageable and REST API - Get sorted list of products for different query parameters on /products resource.

The matrix parameter "spgid" is optional and it stands for personalization Group Based Caching. If not provided - the Web Adapter will NOT cache the response from the Rest call.

Response for anonymous customers is NOT cached, even if "spgid" parameter is provided. This means that anonymous customers always get not cached response and there is NO need to provide "spgid" if this rest call is executed without authorization. If "spgid" is provided in the URI for unregistered customer, then this "faulty" spgid is removed from the result URIs (LinkROs with product URI).

Response for the currently logged in customer is cached only if "spgid" parameter is provided and it contains a valid personalization group ID as a value. Usually this personalization group is retrieved from the session of the current user. If "spgid" is not provided in the URI for logged in customer, then the response is NOT cached by the webadapter but the result URIs (LinkROs with product URI) contain this "spgid" parameter in order to be cached when a call is performed based on the generated URIs. If the "spgid" is not valid then an empty list is returned.

Cartridge

app_sf_rest
Application

B2C Web Shop, SMB Web Shop

Product Version

7.8

Product To Version

 
Status

final

JSON

Request data format

Request related java object

n/a

Request data example

n/a

Response data format

application/json

Response related java object

com.intershop.component.rest.capi.resourceobject.ResourceCollectionRO
com.intershop.component.rest.capi.resourceobject.LinkRO

Response data example

Anonymous customer: /products

...
{
   "type": "Link",
   "uri": "inSPIRED-inTRONICS-Site/-/products/5787761",
   "title": "AC Ryan Playon!HD 1.5TB Full HD Network Media Player",
   "description": "Playon!HD, 8.89 cm (3.5 ") 1.5TB, Fast Ethernet, WLAN 802.11 b/g/n, black"
}
...

Anonymous customer: /products;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000

...
{
   "type": "Link",
   "uri": "inSPIRED-inTRONICS-Site/-/products/5787761",
   "title": "AC Ryan Playon!HD 1.5TB Full HD Network Media Player",
   "description": "Playon!HD, 8.89 cm (3.5 ") 1.5TB, Fast Ethernet, WLAN 802.11 b/g/n, black"
}
...

Authenticated customer: /products

...
{
   "type": "Link",
   "uri": "inSPIRED-inTRONICS-Site/-/products;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000/5787761",
   "title": "AC Ryan Playon!HD 1.5TB Full HD Network Media Player",
   "description": "Playon!HD, 8.89 cm (3.5 ") 1.5TB, Fast Ethernet, WLAN 802.11 b/g/n, black"
}
...

Authenticated customer: /products;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000

...
{
   "type": "Link",
   "uri": "inSPIRED-inTRONICS-Site/-/products;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000/5787761",
   "title": "AC Ryan Playon!HD 1.5TB Full HD Network Media Player",
   "description": "Playon!HD, 8.89 cm (3.5 ") 1.5TB, Fast Ethernet, WLAN 802.11 b/g/n, black"
}
...


XML

Request data format

Request related java object

n/a

Request data example

n/a

Response data format

text/xml

Response related java object

com.intershop.component.rest.capi.resourceobject.ResourceCollectionRO
com.intershop.component.rest.capi.resourceobject.LinkRO

Response data example

Anonymous customer: /products

...
<Link type="Link">
   <description>Playon!HD, 8.89 cm (3.5 ") 1.5TB, Fast Ethernet, WLAN 802.11 b/g/n, black</description>
   <title>AC Ryan Playon!HD 1.5TB Full HD Network Media Player</title>
   <uri>inSPIRED-inTRONICS-Site/-/products/5787761</uri>
</Link>
...

Anonymous customer: /products;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000

...
<Link type="Link">
   <description>Playon!HD, 8.89 cm (3.5 ") 1.5TB, Fast Ethernet, WLAN 802.11 b/g/n, black</description>
   <title>AC Ryan Playon!HD 1.5TB Full HD Network Media Player</title>
   <uri>inSPIRED-inTRONICS-Site/-/products/5787761</uri>
</Link>
...

Authenticated customer: /products

...
<Link type="Link">
   <description>Playon!HD, 8.89 cm (3.5 ") 1.5TB, Fast Ethernet, WLAN 802.11 b/g/n, black</description>
   <title>AC Ryan Playon!HD 1.5TB Full HD Network Media Player</title>
   <uri>inSPIRED-inTRONICS-Site/-/products;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000/5787761</uri>
</Link>
...

Authenticated customer: /products;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000

...
<Link type="Link">
   <description>Playon!HD, 8.89 cm (3.5 ") 1.5TB, Fast Ethernet, WLAN 802.11 b/g/n, black</description>
   <title>AC Ryan Playon!HD 1.5TB Full HD Network Media Player</title>
   <uri>inSPIRED-inTRONICS-Site/-/products;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000/5787761</uri>
</Link>
...


Disclaimer

The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.

Customer Support
Knowledge Base
Product Resources
Support Tickets