List item collections

Last update: 2024-08-29
  • Created for:
  • Experienced
    Developer

Collections, also known as item collections, allow you to categorize and group your decision items according to your preferences. These categories are created by crafting rules that leverage the attributes of decision items.

You can view a list of all item collections by performing a single GET request to the Offer Library API.

API format

GET /{ENDPOINT_PATH}/item-collections?{QUERY_PARAMS}
Parameter Description Example
{ENDPOINT_PATH} The endpoint path for persistence APIs. https://platform.adobe.io/data/core/dps
{QUERY_PARAMS} Optional query parameters to filter results by. limit=2

Using query parameters

You can use query parameters to page and filter results when listing resources.

Paging

The most common query parameters for paging include:

Parameter Description Example
property An optional property filter:
  • The properties are grouped by AND operation.
  • Parameters can be repeated like so: property={PROPERTY_EXPR}[&property={PROPERTY_EXPR2}…] or property={PROPERTY_EXPR1}[,{PROPERTY_EXPR2}…]
  • Property expressions are in format [!]field[op]value, with op in [==,!=,<=,>=,<,>,~], supporting regular expressions.
property=name!=abc&property=id~.*1234.*&property=description equivalent with property=name!=abc,id~.*1234.*,description.
orderBy Sort results by a specific property. Adding a - before name (orderby=-name) will sort items by name in descending order (Z-A). Path expressions are in the form of dot separated paths. This parameter can be repeated like so: orderby=field1[,-fields2,field3,...] orderby=id,-name
limit Limit the number of entities returned. limit=5

Request

curl -X GET 'https://platform.adobe.io/data/core/dps/item-collections?limit=2' \
-H 'Accept: *,application/json' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {IMS_ORG}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'

Response

A successful response returns a list of item collections that you have access to.

{
    "results": [
        {
            "created": "2024-01-31T18:28:52.888Z",
            "modified": "2024-06-28T19:44:13.112Z",
            "etag": 7,
            "schemas": [
                "https://ns.adobe.com/experience/decisioning/item-collection;version=1.2"
            ],
            "createdBy": "{CREATED_BY}",
            "lastModifiedBy": "{MODIFIED_BY}",
            "id": "itemCollection1234",
            "name": "Item collection One",
            "description": "Item collection",
            "constraints": [
                {
                    "itemCatalogId": "itemCatalog1234",
                    "uiModel": "{\"operator\":\"equals\",\"value\":{\"left\":\"_experience.decisioning.decisionitem.itemName\",\"right\":\"Some offer item\"}}"
                }
            ],
            "tags": []
        },
        {
            "created": "2024-06-10T16:02:57.878Z",
            "modified": "2024-06-10T16:02:57.878Z",
            "etag": 1,
            "schemas": [
                "https://ns.adobe.com/experience/decisioning/item-collection;version=1.2"
            ],
            "createdBy": "{CREATED_BY}",
            "lastModifiedBy": "{MODIFIED_BY}",
            "id": "itemCollection5678",
            "name": "Item collection One",
            "description": "Item collection",
            "constraints": [
                {
                    "itemCatalogId": "itemCatalog1234",
                    "uiModel": "{\"operator\":\"greater than\",\"value\":{\"left\":\"_<imsOrg>.some_integer\",\"right\":100}}"
                }
            ],
            "tags": []
        }
    ],
    "count": 2,
    "total": 166,
    "_links": {
        "self": {
            "href": "/item-collections?orderby=-modified&limit=2",
            "type": "application/json"
        },
        "next": {
            "href": "/item-collections?orderby=-modified&limit=2&start=2024-06-04T23:37:33.980Z",
            "type": "application/json"
        }
    }
}

On this page