Related Documents
Document Properties
Kbid279G54
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 category


Note

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

URI

/categories;spgid=<personalization_group_id>/<catID>/products

/categories/<catID>/products;spgid=<personalization_group_id>

Http Method

GET

Short Description

Get a list of products of a (sub-) category. If the 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

/categories;spgid=gGqKDaxstt0000whc8sEo8Fd0000/Computers/3001/903/products,

/categories;spgid=gGqKDaxstt0000whc8sEo8Fd0000/Computers/3001/903/products?amount=2&offset=2,

/categories/Computers/3001/903/products;spgid=gGqKDaxstt0000whc8sEo8Fd0000,

/categories/Computers/3001/903/products;spgid=gGqKDaxstt0000whc8sEo8Fd0000?amount=2&offset=2

HTTP Status Codes

200 OK

404 Not found

Description

Equivalent to /categories/<catID>/products but in addition "spgid" matrix parameter is provided and used for personalized caching. See REST API - Get list of products category (until 7.8)REST API - Get list of products with pageable category and REST API - Get sorted list of products category for different query parameters on /categories/<catID>/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 (at /categories OR /products path segment, OR both) 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 provided on both places (e.g., /categories;spgid=gGqKDaxstt0000whc8sEo8Fd0000/Computers/3001/903/products;spgid=gGqKDaxstt0000whc8sEo8Fd0000) the response is cached by the Web Adapter but the result URIs (LinkROs with product URI) contain "spgid" only at /products path segment. If "spgid" is not provided in the URI for logged in customer, then the response is NOT cached by the Web Adapter 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: /categories/Computers/106/911/products

...
{
   "type": "Link",
   "uri": "inSPIRED-inTRONICS-Site/-/categories/Computers/106/911/products/11103582",
   "title": "A-DATA 1GB PC3200",
   "description": "1GB DDR, 200-pin SODIMM, 400MHz, CL3, Unbuffered, Non-ECC"
}
...

Anonymous customer: /categories;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000/Computers/106/911/products

...
{
   "type": "Link",
   "uri": "inSPIRED-inTRONICS-Site/-/categories/Computers/106/911/products/11103582",
   "title": "A-DATA 1GB PC3200",
   "description": "1GB DDR, 200-pin SODIMM, 400MHz, CL3, Unbuffered, Non-ECC"
}
...

Anonymous customer: /categories/Computers/106/911/products;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000

...
{
   "type": "Link",
   "uri": "inSPIRED-inTRONICS-Site/-/categories/Computers/106/911/products/11103582",
   "title": "A-DATA 1GB PC3200",
   "description": "1GB DDR, 200-pin SODIMM, 400MHz, CL3, Unbuffered, Non-ECC"
}
...

Anonymous customer: /categories;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000/Computers/106/911/products;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000

...
{
   "type": "Link",
   "uri": "inSPIRED-inTRONICS-Site/-/categories/Computers/106/911/products/11103582",
   "title": "A-DATA 1GB PC3200",
   "description": "1GB DDR, 200-pin SODIMM, 400MHz, CL3, Unbuffered, Non-ECC"
}
...

Authenticated customer: /categories/Computers/106/911/products

...
{
   "type": "Link",
   "uri": "inSPIRED-inTRONICS-Site/-/categories/Computers/106/911/products;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000/11103582",
   "title": "A-DATA 1GB PC3200",
   "description": "1GB DDR, 200-pin SODIMM, 400MHz, CL3, Unbuffered, Non-ECC"
}
...

Authenticated customer: /categories;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000/Computers/106/911/products

...
{
   "type": "Link",
   "uri": "inSPIRED-inTRONICS-Site/-/categories;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000/Computers/106/911/products/11103582",
   "title": "A-DATA 1GB PC3200",
   "description": "1GB DDR, 200-pin SODIMM, 400MHz, CL3, Unbuffered, Non-ECC"
}
...

Authenticated customer: /categories/Computers/106/911/products;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000

...
{
   "type": "Link",
   "uri": "inSPIRED-inTRONICS-Site/-/categories/Computers/106/911/products;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000/11103582",
   "title": "A-DATA 1GB PC3200",
   "description": "1GB DDR, 200-pin SODIMM, 400MHz, CL3, Unbuffered, Non-ECC"
}
...

Authenticated customer: /categories;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000/Computers/106/911/products;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000

...
{
   "type": "Link",
   "uri": "inSPIRED-inTRONICS-Site/-/categories/Computers/106/911/products;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000/11103582",
   "title": "A-DATA 1GB PC3200",
   "description": "1GB DDR, 200-pin SODIMM, 400MHz, CL3, Unbuffered, Non-ECC"
}
...


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: /categories/Computers/106/911/products

...
<Link type="Link">
   <description>1GB DDR, 200-pin SODIMM, 400MHz, CL3, Unbuffered, Non-ECC</description>
   <title>A-DATA 1GB PC3200</title>
   <uri>inSPIRED-inTRONICS-Site/-/categories/Computers/106/911/products/11103582</uri>
</Link>
...

Anonymous customer: /categories;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000/Computers/106/911/products

...
<Link type="Link">
   <description>1GB DDR, 200-pin SODIMM, 400MHz, CL3, Unbuffered, Non-ECC</description>
   <title>A-DATA 1GB PC3200</title>
   <uri>inSPIRED-inTRONICS-Site/-/categories/Computers/106/911/products/11103582</uri>
</Link>
...

Anonymous customer: /categories/Computers/106/911/products;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000

...
<Link type="Link">
   <description>1GB DDR, 200-pin SODIMM, 400MHz, CL3, Unbuffered, Non-ECC</description>
   <title>A-DATA 1GB PC3200</title>
   <uri>inSPIRED-inTRONICS-Site/-/categories/Computers/106/911/products/11103582</uri>
</Link>
...

Anonymous customer: /categories;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000/Computers/106/911/products;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000

...
<Link type="Link">
   <description>1GB DDR, 200-pin SODIMM, 400MHz, CL3, Unbuffered, Non-ECC</description>
   <title>A-DATA 1GB PC3200</title>
   <uri>inSPIRED-inTRONICS-Site/-/categories/Computers/106/911/products/11103582</uri>
</Link>
...

Authenticated customer: /categories/Computers/106/911/products

...
<Link type="Link">
   <description>1GB DDR, 200-pin SODIMM, 400MHz, CL3, Unbuffered, Non-ECC</description>
   <title>A-DATA 1GB PC3200</title>
   <uri>inSPIRED-inTRONICS-Site/-/categories/Computers/106/911/products;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000/11103582</uri>
</Link>
...

Authenticated customer: /categories;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000/Computers/106/911/products

...
<Link type="Link">
   <description>1GB DDR, 200-pin SODIMM, 400MHz, CL3, Unbuffered, Non-ECC</description>
   <title>A-DATA 1GB PC3200</title>
   <uri>inSPIRED-inTRONICS-Site/-/categories;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000/Computers/106/911/products/11103582</uri>
</Link>
...

Authenticated customer: /categories/Computers/106/911/products;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000

...
<Link type="Link">
   <description>1GB DDR, 200-pin SODIMM, 400MHz, CL3, Unbuffered, Non-ECC</description>
   <title>A-DATA 1GB PC3200</title>
   <uri>inSPIRED-inTRONICS-Site/-/categories/Computers/106/911/products;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000/11103582</uri>
</Link>
...

Authenticated customer: /categories;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000/Computers/106/911/products;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000

...
<Link type="Link">
   <description>1GB DDR, 200-pin SODIMM, 400MHz, CL3, Unbuffered, Non-ECC</description>
   <title>A-DATA 1GB PC3200</title>
   <uri>inSPIRED-inTRONICS-Site/-/categories/Computers/106/911/products;spgid=4E6Q8F1JBYc000TWY3IKC0Nb0000/11103582</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