Obtain the results from the recommendation by apiName.
get
/content/published/api/v1.1/personalization/recommendationResults/{apiName}
Obtain the results of the recommendation specified by the apiName. 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.
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
-
apiName: string
API name of the recommendation. Any special characters present must be encoded.
Query Parameters
-
attribute.category.attributeName(optional): array
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 -
channelToken(optional): string
Channel token of the publish target. A channel token must be provided as either a query parameter or a request header.
-
fields(optional): string
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
-
limit(optional): integer(int32)
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
-
links(optional): string
Accepts a comma-separated list of rel (relation) links, which the client requires in the results. By default, all the applicable links in a resource are included in the response. Possible values are: self, canonical, describedby, first, last, prev, next.
Example: links=self,canonical will only return the links with the rel property self or canonical. -
offset(optional): integer(int32)
Start index of response rows.Default Value:
0
-
totalResults(optional): boolean
Accepts a Boolean value. Setting it to true displays the total results field in the response.Default Value:
false
Response
Supported Media Types
- application/json
200 Response
Successful operation.
Root Schema : CollectionProperties
Type:
object
CollectionProperties.
Show Source
-
aggregationResults(optional):
array aggregationResults
Aggregation results.
-
count(optional):
integer(int32)
Total number of records in the current response.
-
hasMore(optional):
boolean
Check whether there are more pages to fetch.
-
items(optional):
array items
Singular resources contained in the collection.
-
limit(optional):
integer(int32)
Actual page size used by the server. This might not be the same as what the client requests.
-
links(optional):
array links
Links of the resource.
-
offset(optional):
integer(int32)
The actual index from which the singular resources are returned.
-
pinned(optional):
array pinned
Pinned items. Shows items pinned at the top of search list
-
properties(optional):
object properties
Additional Properties Allowed: additionalPropertiesadditional collection properties.
-
scrollId(optional):
string
scrollId if the search resolved to a scroll search.
-
totalResults(optional):
integer(int32)
Total number of rows that satisfy the client request (excluding the paging parameters.)
Nested Schema : links
Type:
array
Links of the resource.
Show Source
-
Array of:
object Link
Link of the resource.
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 : items
Type:
object
Nested Schema : Link
Type:
object
Link of the resource.
Show Source
-
href(optional):
string
The target resource's URI. It could be template URI. It is a required property in the get response.
-
mediaType(optional):
string
Media type.
-
method(optional):
string
What HTTP method can be used to access the target resource.
-
profile(optional):
string
Link to the metadata that describes the target resource.
-
rel(optional):
string
Relation type. It is a required property in the get response.
-
templated(optional):
boolean
Whether the URI is a template.
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.
Examples
The following example shows how to obtain the results of the recommendation specified by the apiName.
curl -i -X GET -H "Accept:application/json" 'http://<hostname>/content/published/api/v1.1/personalization/recommendationResults/{apiName}'
Example 1
Obtains Recommendaion results with Recommendation name: Recommendation11974403372156002, with channelToken: 412c51726a5f4104b63e1f118c5014fa.
/content/published/api/v1.1/personalization/recommendationResults/Recommendation11974403372156002?channelToken=412c51726a5f4104b63e1f118c5014fa&fields=all
Response Body
{ "hasMore": false, "offset": 0, "count": 4, "limit": 4, "totalResults": 4, "items": [ { "createdDate": { "value": "2020-07-09T09:04:25.380Z", "timezone": "UTC" }, "taxonomies": { "items": [] }, "name": "contentItem4ComplexTypePub-1972775689152004", "description": "Complex item - 1972775689229005", "language": "en-US", "links": [ { "href": "https://<hostname>/content/published/api/v1.1/items/CORE21594FFAE0CD4F0C8B037ABF6CC57FA7?channelToken=412c51726a5f4104b63e1f118c5014fa", "rel": "self", "method": "GET", "mediaType": "application/json" } ], "updatedDate": { "value": "2020-07-09T09:04:25.380Z", "timezone": "UTC" }, "id": "CORE21594FFAE0CD4F0C8B037ABF6CC57FA7", "type": "1972628970332003-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": "1481786051358-contentitem4complextypepub-1972775689152004" }, { "createdDate": { "value": "2020-07-09T09:04:25.380Z", "timezone": "UTC" }, "taxonomies": { "items": [] }, "name": "contentItem2ComplexTypePub-1972749389554000", "description": "Complex item - 1972749389631001", "language": "en-US", "links": [ { "href": "https://<hostname>/content/published/api/v1.1/items/COREB864859F559C465685B21D2A09A06164?channelToken=412c51726a5f4104b63e1f118c5014fa", "rel": "self", "method": "GET", "mediaType": "application/json" } ], "updatedDate": { "value": "2020-07-09T09:04:25.380Z", "timezone": "UTC" }, "id": "COREB864859F559C465685B21D2A09A06164", "type": "1972628970332003-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": "1481786051340-contentitem2complextypepub-1972749389554000" }, { "createdDate": { "value": "2020-07-09T09:04:25.380Z", "timezone": "UTC" }, "taxonomies": { "items": [] }, "name": "contentItem1ComplexTypePub-1972734518261008", "description": "Complex item - 1972734518331009", "language": "en-US", "links": [ { "href": "https://<hostname>/content/published/api/v1.1/items/CORE3DC46F876F0245B389E3397981A82F8C?channelToken=412c51726a5f4104b63e1f118c5014fa", "rel": "self", "method": "GET", "mediaType": "application/json" } ], "updatedDate": { "value": "2020-07-09T09:04:25.380Z", "timezone": "UTC" }, "id": "CORE3DC46F876F0245B389E3397981A82F8C", "type": "1972628970332003-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": "1481786051331-contentitem1complextypepub-1972734518261008" }, { "createdDate": { "value": "2020-07-09T09:04:25.380Z", "timezone": "UTC" }, "taxonomies": { "items": [] }, "name": "contentItem3ComplexType-1972762577241002", "description": "Complex item - 1972762577297003", "language": "en-US", "links": [ { "href": "https://<hostname>/content/published/api/v1.1/items/CORE4329B9D26FB64F21B91B26E0AF938185?channelToken=412c51726a5f4104b63e1f118c5014fa", "rel": "self", "method": "GET", "mediaType": "application/json" } ], "updatedDate": { "value": "2020-07-09T09:04:25.380Z", "timezone": "UTC" }, "id": "CORE4329B9D26FB64F21B91B26E0AF938185", "type": "1972628970332003-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": "1481786051349-contentitem3complextype-1972762577241002" } ], "links": [ { "href": "https://<hostname>/content/published/api/v1.1/personalization/recommendationResults/Recommendation11974403372156002?fields=all&channelToken=412c51726a5f4104b63e1f118c5014fa", "rel": "self", "method": "GET", "mediaType": "application/json" }, { "href": "https://<hostname>/content/published/api/v1.1/personalization/recommendationResults/Recommendation11974403372156002?fields=all&channelToken=412c51726a5f4104b63e1f118c5014fa", "rel": "canonical", "method": "GET", "mediaType": "application/json" }, { "href": "https://<hostname>/content/published/api/v1.1/metadata-catalog/personalization/recommendationResults/Recommendation11974403372156002?channelToken=412c51726a5f4104b63e1f118c5014fa", "rel": "describedby", "method": "GET", "mediaType": "application/schema+json" }, { "href": "https://<hostname>/content/published/api/v1.1/personalization/recommendationResults/Recommendation11974403372156002?fields=all&offset=0&channelToken=412c51726a5f4104b63e1f118c5014fa", "rel": "first", "method": "GET", "mediaType": "application/json" }, { "href": "https://<hostname>/content/published/api/v1.1/personalization/recommendationResults/Recommendation11974403372156002?fields=all&offset=0&channelToken=412c51726a5f4104b63e1f118c5014fa", "rel": "last", "method": "GET", "mediaType": "application/json" }
Example 2
Obtains Recommendation results with Recommendation apiName: Recommendation11988863495072004, with channelToken:7b75d02e298d44b0817ac540b98e89e3 and custom attributes.
/content/published/api/v1.1/personalization/recommendationResults/Recommendation11988863495072004?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", "typeCategory": "ContentType", "type": "1984424437842003-testRecommendation-complexType", "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/Recommendation11988863495072004?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/Recommendation11988863495072004?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/Recommendation11988863495072004?channelToken=7b75d02e298d44b0817ac540b98e89e3", "rel": "describedby", "method": "GET", "mediaType": "application/schema+json" }, { "href": "https://<hostname>/content/published/api/v1.1/personalization/recommendationResults/Recommendation11988863495072004?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/Recommendation11988863495072004?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" } ] } } ]