Obtain the results from the recommendation by id.

get

/content/published/api/v1.1/personalization/recommendationResults/.by.id/{id}

Obtain the results of the recommendation specified by the recommendation id. This endpoint is used to run the recommendation by specifying values for the audience attributes defined in the recommendation.

Audience attributes must be specified as part of the query parameters as name value pairs prepended with the keyword attribute as follows: attribute.\.\=\

Example: ?attribute.custom.myAttribute1=value1&attribute.custom.myAttribute2=value2



Where multivalued audience attributes are allowed, they should be provided in the query by repeating the name value pairs.

Example: ?attribute.custom.myMultiValue=value1&attribute.custom.myMultiValue=value2 etc.

Request

Path Parameters
Query Parameters
  • Collection Format: multi
    List of audience attributes. Any special characters present must be encoded.The audience attributes should be prefixed with the keyword attribute:

    attribute.\.\=\

    Example: ?attribute.custom.myAttribute1=value1&attribute.custom.myAttribute2=value2

  • Channel token of the publish target. A channel token must be provided as either a query parameter or a request header.
  • The fields parameter is used to control the returned fields and values in the queried item. This parameter accepts a comma-separated list of field names or all. All the user-defined field names should be provided with prefix fields and followed by a period (.). These fields will be returned for each queried item. As all the field names are case-sensitive, users must provide the correct field names in the search query. When fields is specified as all (case-insensitive), in case of a type-specific query, all the standard fields, and user-defined fields except largetext, json, location datatype are returned for each queried item, whereas in case of a query across all types, only all standard fields are returned. The standard fields id and type are always returned in the response and cannot be filtered out. This parameter is optional in the query and by default query result shows only id, name, description, and type in the response. Any incorrect or invalid field name given in the query will be ignored.

    In the context of a brace style cross-type query, type specific fields may be specified using syntax name,{typename1:fields.userdefinedfieldname1,fields.userdefinedfieldname2},{typename2:fields.userdefinedfieldname1}.In the preceding example, all items of type typename1 will have fields - name, userdefinedfieldname1 and userdefinedfieldname2, while all items of type typename2 will have fields - name, userdefinedfieldname1. If the cross-type query does not resolve to types referenced in the typed fields clause(s), an error will be thrown. Example: ?q=(type eq "LocationType")&fields=fields.state,fields.country,updatedDate
    This returns id, type, state, country, updatedDate in the search results for a LocationType with state and country fields.
    Example: ?q=(type eq "LocationType")&fields=all
    This will return all standard fields and all user-defined fields except largetext, json, location data types
    Example: ?fields=all
    This will return only standard fields (id, type, typeCategory, name, description, slug, language, createdDate, updatedDate, taxonomies, renditions) since Type is not used in the search query (acts as a Global query)
    Example: ?fields=name,createdDate
    This will return only standard fields (such as id, name, createdDate and type) since Type is not used in the search query (acts as a Global query)
    Default Value: name,description
  • This parameter accepts a non negative integer and is used to control the size of the result. The maximum value allowed for limit is 500.
    Default Value: 100
  • Start index of response rows.
    Default Value: 0
  • Accepts a Boolean value. Setting it to true displays the total results field in the response.
    Default Value: false
Back to Top

Response

Supported Media Types

200 Response

Successful operation.
Body ()
Root Schema : CollectionProperties
Type: object
CollectionProperties.
Show Source
Nested Schema : aggregationResults
Type: array
Aggregation results.
Show Source
Nested Schema : items
Type: array
Singular resources contained in the collection.
Show Source
Nested Schema : pinned
Type: array
Pinned items. Shows items pinned at the top of search list
Show Source
Nested Schema : properties
Type: object
Additional Properties Allowed
Show Source
additional collection properties.
Nested Schema : AggregationResult
Type: object
Show Source
Nested Schema : items
Type: object
Nested Schema : additionalProperties
Type: object

400 Response

Bad Request. The server is unable to process the request on the client side due to malformed syntax, invalid data or message framing.

403 Response

Forbidden. Client is not authorized to perform this request.

500 Response

Internal server error. An unexpected error condition encountered in the system.
Back to Top

Examples

The following example shows how to obtain published Recommendation results with id.

curl -i -X GET -H "Accept:application/json" 'http://<hostname>/content/published/api/v1.1/personalization/recommendationResults/.by.id/{id}'
Example 1

Obtains Recommendaion results with Recommendation id: RECO9DAF2D6B079140589709992EC922A5B9, with channelToken:4c37d9759b9c42a2a0fec12d7563f025.

/content/published/api/v1.1/personalization/recommendationResults/.by.id/RECO9DAF2D6B079140589709992EC922A5B9?channelToken=4c37d9759b9c42a2a0fec12d7563f025&fields=all

Response Body

{
        "hasMore": false,
        "offset": 0,
        "count": 2,
        "limit": 2,
        "totalResults": 2,
        "items": [
          {
            "createdDate": {
              "value": "2020-07-09T09:23:56.132Z",
              "timezone": "UTC"
            },
            "taxonomies": {
              "items": []
            },
            "name": "contentItem1ComplexTypePub-1984512446212008",
            "description": "Complex item - 1984512446307009",
            "typeCategory": "ContentType",
            "language": "en-US",
            "links": [
              {
                "href": "https://<hostname>/content/published/api/v1.1/items/COREF5E09688F7D14EA9BEE71048323C0AB3?channelToken=4c37d9759b9c42a2a0fec12d7563f025",
                "rel": "self",
                "method": "GET",
                "mediaType": "application/json"
              }
            ],
            "id": "COREF5E09688F7D14EA9BEE71048323C0AB3",
            "updatedDate": {
              "value": "2020-07-09T09:23:56.132Z",
              "timezone": "UTC"
            },
            "type": "1984424437842003-testRecommendation-complexType",
            "fields": {
              "subdivision-1-code": "CA",
              "Text_single_1": "Single value",
              "Number_1": 211,
              "Text_multi_1": [
                "Aaa bbb ccc",
                "Ddd eee fff"
              ],
              "City-name-1": "San Francisco",
              "Decimal_1": 1.11,
              "Date_1": {
                "value": "2019-01-01T01:00:00.001Z",
                "timezone": "UTC"
              },
              "Boolean_1": true,
              "subdivision-1-name": "California"
            },
            "slug": "1481786052033-contentitem1complextypepub-1984512446212008"
          },
          {
            "createdDate": {
              "value": "2020-07-09T09:23:56.132Z",
              "timezone": "UTC"
            },
            "taxonomies": {
              "items": []
            },
            "name": "contentItem2ComplexTypePub-1984526430280000",
            "description": "Complex item - 1984526430338001",
            "language": "en-US",
            "links": [
              {
                "href": "https://<hostname>/content/published/api/v1.1/items/COREBCB44A76F4BB4E7FB188FE1936303012?channelToken=4c37d9759b9c42a2a0fec12d7563f025",
                "rel": "self",
                "method": "GET",
                "mediaType": "application/json"
              }
            ],
            "id": "COREBCB44A76F4BB4E7FB188FE1936303012",
            "updatedDate": {
              "value": "2020-07-09T09:23:56.132Z",
              "timezone": "UTC"
            },
            "type": "1984424437842003-testRecommendation-complexType",
            "typeCategory": "ContentType",
            "fields": {
              "subdivision-1-code": "CA",
              "Text_single_1": "Single value",
              "Number_1": 311,
              "Text_multi_1": [
                "Aaa bbb ccc",
                "Ddd eee fff"
              ],
              "City-name-1": "San Francisco",
              "Decimal_1": 1.11,
              "Date_1": {
                "value": "2019-01-01T01:00:00.001Z",
                "timezone": "UTC"
              },
              "Boolean_1": true,
              "subdivision-1-name": "California"
            },
            "slug": "1481786052042-contentitem2complextypepub-1984526430280000"
          }
        ],
        "links": [
          {
            "href": "https://<hostname>/content/published/api/v1.1/personalization/recommendationResults/.by.id/RECO9DAF2D6B079140589709992EC922A5B9?fields=all&channelToken=4c37d9759b9c42a2a0fec12d7563f025",
            "rel": "self",
            "method": "GET",
            "mediaType": "application/json"
          },
          {
            "href": "https://<hostname>/content/published/api/v1.1/personalization/recommendationResults/.by.id/RECO9DAF2D6B079140589709992EC922A5B9?fields=all&channelToken=4c37d9759b9c42a2a0fec12d7563f025",
            "rel": "canonical",
            "method": "GET",
            "mediaType": "application/json"
          },
          {
            "href": "https://<hostname>/content/published/api/v1.1/metadata-catalog/personalization/recommendationResults/.by.id/RECO9DAF2D6B079140589709992EC922A5B9?channelToken=4c37d9759b9c42a2a0fec12d7563f025",
            "rel": "describedby",
            "method": "GET",
            "mediaType": "application/schema+json"
          },
          {
            "href": "https://<hostname>/content/published/api/v1.1/personalization/recommendationResults/.by.id/RECO9DAF2D6B079140589709992EC922A5B9?fields=all&offset=0&channelToken=4c37d9759b9c42a2a0fec12d7563f025",
            "rel": "first",
            "method": "GET",
            "mediaType": "application/json"
          },
          {
            "href": "https://<hostname>/content/published/api/v1.1/personalization/recommendationResults/.by.id/RECO9DAF2D6B079140589709992EC922A5B9?fields=all&offset=0&channelToken=4c37d9759b9c42a2a0fec12d7563f025",
            "rel": "last",
            "method": "GET",
            "mediaType": "application/json"
          }     
        
Example 2

Obtains Recommendation results with Recommendation id: RECOF7E733CC021B4D968D9F9B25E7151F03,with channelToken: 7b75d02e298d44b0817ac540b98e89e3 and audience attributes.

/content/published/api/v1.1/personalization/recommendationResults/.by.id/RECOF7E733CC021B4D968D9F9B25E7151F03?attribute.custom.attribute-ts-1=Single+value&channelToken=7b75d02e298d44b0817ac540b98e89e3&fields=all&attribute.custom.attribute-int-1=10

Response Body

{
        "hasMore": false,
        "offset": 0,
        "count": 6,
        "limit": 6,
        "totalResults": 6,
        "items": [
          {
            "createdDate": {
              "value": "2020-07-09T09:24:03.490Z",
              "timezone": "UTC"
            },
            "taxonomies": {
              "items": []
            },
            "name": "contentItem6ComplexType-1984576426766008",
            "description": "Complex item - 1984576426845009",
            "language": "en-US",
            "links": [
              {
                "href": "https://<hostname>/content/published/api/v1.1/items/CORE41B5714CA50A446B864F363327021215?channelToken=7b75d02e298d44b0817ac540b98e89e3",
                "rel": "self",
                "method": "GET",
                "mediaType": "application/json"
              }
            ],
            "updatedDate": {
              "value": "2020-07-09T09:24:03.490Z",
              "timezone": "UTC"
            },
            "id": "CORE41B5714CA50A446B864F363327021215",
            "type": "1984424437842003-testRecommendation-complexType",
            "typeCategory": "ContentType",
            "fields": {
              "subdivision-1-code": "CA",
              "Text_single_1": "Single value",
              "Number_1": 711,
              "Text_multi_1": [
                "Aaa bbb ccc",
                "Ddd eee fff"
              ],
              "City-name-1": "San Francisco",
              "Decimal_1": 1.11,
              "Date_1": {
                "value": "2019-01-01T01:00:00.001Z",
                "timezone": "UTC"
              },
              "Boolean_1": true,
              "subdivision-1-name": "California"
            },
            "slug": "1481786052078-contentitem6complextype-1984576426766008"
          },
          {
            "createdDate": {
              "value": "2020-07-09T09:24:03.490Z",
              "timezone": "UTC"
            },
            "taxonomies": {
              "items": []
            },
            "name": "contentItem5ComplexTypePub-1984563392421006",
            "description": "Complex item - 1984563392490007",
            "language": "en-US",
            "links": [
              {
                "href": "https://<hostname>/content/published/api/v1.1/items/CORE3195C2E6CA564B3B8B8825AE872408E2?channelToken=7b75d02e298d44b0817ac540b98e89e3",
                "rel": "self",
                "method": "GET",
                "mediaType": "application/json"
              }
            ],
            "updatedDate": {
              "value": "2020-07-09T09:24:03.490Z",
              "timezone": "UTC"
            },
            "id": "CORE3195C2E6CA564B3B8B8825AE872408E2",
            "type": "1984424437842003-testRecommendation-complexType",
            "typeCategory": "ContentType",
            "fields": {
              "subdivision-1-code": "CA",
              "Text_single_1": "Single value",
              "Number_1": 611,
              "Text_multi_1": [
                "Aaa bbb ccc",
                "Ddd eee fff"
              ],
              "City-name-1": "San Francisco",
              "Decimal_1": 1.11,
              "Date_1": {
                "value": "2019-01-01T01:00:00.001Z",
                "timezone": "UTC"
              },
              "Boolean_1": true,
              "subdivision-1-name": "California"
            },
            "slug": "1481786052069-contentitem5complextypepub-1984563392421006"
          },
          {
            "createdDate": {
              "value": "2020-07-09T09:24:03.490Z",
              "timezone": "UTC"
            },
            "taxonomies": {
              "items": []
            },
            "name": "contentItem3ComplexType-1984537958974002",
            "description": "Complex item - 1984537959031003",
            "language": "en-US",
            "links": [
              {
                "href": "https://<hostname>/content/published/api/v1.1/items/CORE2512057F40DE4DE49E8EA289098B52BF?channelToken=7b75d02e298d44b0817ac540b98e89e3",
                "rel": "self",
                "method": "GET",
                "mediaType": "application/json"
              }
            ],
            "updatedDate": {
              "value": "2020-07-09T09:24:03.490Z",
              "timezone": "UTC"
            },
            "id": "CORE2512057F40DE4DE49E8EA289098B52BF",
            "type": "1984424437842003-testRecommendation-complexType",
            "typeCategory": "ContentType",
            "fields": {
              "subdivision-1-code": "CA",
              "Text_single_1": "Single value",
              "Number_1": 411,
              "Text_multi_1": [
                "Aaa bbb ccc",
                "Ddd eee fff"
              ],
              "City-name-1": "San Francisco",
              "Decimal_1": 1.11,
              "Date_1": {
                "value": "2019-01-01T01:00:00.001Z",
                "timezone": "UTC"
              },
              "Boolean_1": true,
              "subdivision-1-name": "California"
            },
            "slug": "1481786052051-contentitem3complextype-1984537958974002"
          },
          {
            "createdDate": {
              "value": "2020-07-09T09:29:26.577Z",
              "timezone": "UTC"
            },
            "taxonomies": {
              "items": []
            },
            "name": "contentItem2ComplexTypePub-1984526430280000",
            "description": "Complex item - 1984526430338001",
            "language": "en-US",
            "links": [
              {
                "href": "https://<hostname>/content/published/api/v1.1/items/COREBCB44A76F4BB4E7FB188FE1936303012?channelToken=7b75d02e298d44b0817ac540b98e89e3",
                "rel": "self",
                "method": "GET",
                "mediaType": "application/json"
              }
            ],
            "updatedDate": {
              "value": "2020-07-09T09:29:26.577Z",
              "timezone": "UTC"
            },
            "id": "COREBCB44A76F4BB4E7FB188FE1936303012",
            "type": "1984424437842003-testRecommendation-complexType",
            "typeCategory": "ContentType",
            "fields": {
              "subdivision-1-code": "CA",
              "Text_single_1": "Single value",
              "Number_1": 311,
              "Text_multi_1": [
                "Aaa bbb ccc",
                "Ddd eee fff"
              ],
              "City-name-1": "San Francisco",
              "Decimal_1": 1.11,
              "Date_1": {
                "value": "2019-01-01T01:00:00.001Z",
                "timezone": "UTC"
              },
              "Boolean_1": true,
              "subdivision-1-name": "California"
            },
            "slug": "1481786052042-contentitem2complextypepub-1984526430280000"
          },
          {
            "createdDate": {
              "value": "2020-07-09T09:24:03.490Z",
              "timezone": "UTC"
            },
            "taxonomies": {
              "items": []
            },
            "name": "contentItem4ComplexTypePub-1984550886423004",
            "description": "Complex item - 1984550886495005",
            "language": "en-US",
            "links": [
              {
                "href": "https://<hostname>/content/published/api/v1.1/items/CORE4676E5C2AA1442B18102A2027A923E22?channelToken=7b75d02e298d44b0817ac540b98e89e3",
                "rel": "self",
                "method": "GET",
                "mediaType": "application/json"
              }
            ],
            "updatedDate": {
              "value": "2020-07-09T09:24:03.490Z",
              "timezone": "UTC"
            },
            "id": "CORE4676E5C2AA1442B18102A2027A923E22",
            "type": "1984424437842003-testRecommendation-complexType",
            "typeCategory": "ContentType",
            "fields": {
              "subdivision-1-code": "CA",
              "Text_single_1": "Single value",
              "Number_1": 511,
              "Text_multi_1": [
                "Aaa bbb ccc",
                "Ddd eee fff"
              ],
              "City-name-1": "San Francisco",
              "Decimal_1": 1.11,
              "Date_1": {
                "value": "2019-01-01T01:00:00.001Z",
                "timezone": "UTC"
              },
              "Boolean_1": true,
              "subdivision-1-name": "California"
            },
            "slug": "1481786052060-contentitem4complextypepub-1984550886423004"
          },
          {
            "createdDate": {
              "value": "2020-07-09T09:29:26.577Z",
              "timezone": "UTC"
            },
            "taxonomies": {
              "items": []
            },
            "name": "contentItem1ComplexTypePub-1984512446212008",
            "description": "Complex item - 1984512446307009",
            "language": "en-US",
            "links": [
              {
                "href": "https://<hostname>/content/published/api/v1.1/items/COREF5E09688F7D14EA9BEE71048323C0AB3?channelToken=7b75d02e298d44b0817ac540b98e89e3",
                "rel": "self",
                "method": "GET",
                "mediaType": "application/json"
              }
            ],
            "updatedDate": {
              "value": "2020-07-09T09:29:26.577Z",
              "timezone": "UTC"
            },
            "id": "COREF5E09688F7D14EA9BEE71048323C0AB3",
            "type": "1984424437842003-testRecommendation-complexType",
            "typeCategory": "ContentType",
            "fields": {
              "subdivision-1-code": "CA",
              "Text_single_1": "Single value",
              "Number_1": 211,
              "Text_multi_1": [
                "Aaa bbb ccc",
                "Ddd eee fff"
              ],
              "City-name-1": "San Francisco",
              "Decimal_1": 1.11,
              "Date_1": {
                "value": "2019-01-01T01:00:00.001Z",
                "timezone": "UTC"
              },
              "Boolean_1": true,
              "subdivision-1-name": "California"
            },
            "slug": "1481786052033-contentitem1complextypepub-1984512446212008"
          }
        ],
        "links": [
          {
            "href": "https://<hostname>/content/published/api/v1.1/personalization/recommendationResults/.by.id/RECOF7E733CC021B4D968D9F9B25E7151F03?attribute.custom.attribute-ts-1=Single value&channelToken=7b75d02e298d44b0817ac540b98e89e3&fields=all&attribute.custom.attribute-int-1=10",
            "rel": "self",
            "method": "GET",
            "mediaType": "application/json"
          },
          {
            "href": "https://<hostname>/content/published/api/v1.1/personalization/recommendationResults/.by.id/RECOF7E733CC021B4D968D9F9B25E7151F03?attribute.custom.attribute-ts-1=Single value&channelToken=7b75d02e298d44b0817ac540b98e89e3&fields=all&attribute.custom.attribute-int-1=10",
            "rel": "canonical",
            "method": "GET",
            "mediaType": "application/json"
          },
          {
            "href": "https://<hostname>/content/published/api/v1.1/metadata-catalog/personalization/recommendationResults/.by.id/RECOF7E733CC021B4D968D9F9B25E7151F03?channelToken=7b75d02e298d44b0817ac540b98e89e3",
            "rel": "describedby",
            "method": "GET",
            "mediaType": "application/schema+json"
          },
          {
            "href": "https://<hostname>/content/published/api/v1.1/personalization/recommendationResults/.by.id/RECOF7E733CC021B4D968D9F9B25E7151F03?attribute.custom.attribute-ts-1=Single value&channelToken=7b75d02e298d44b0817ac540b98e89e3&fields=all&offset=0&attribute.custom.attribute-int-1=10",
            "rel": "first",
            "method": "GET",
            "mediaType": "application/json"
          },
          {
            "href": "https://<hostname>/content/published/api/v1.1/personalization/recommendationResults/.by.id/RECOF7E733CC021B4D968D9F9B25E7151F03?attribute.custom.attribute-ts-1=Single value&channelToken=7b75d02e298d44b0817ac540b98e89e3&fields=all&offset=0&attribute.custom.attribute-int-1=10",
            "rel": "last",
            "method": "GET",
            "mediaType": "application/json"
          }
        ]
      }
    }    
  ]
Back to Top