Preview item variations by slug
get
/content/preview/api/v1.1/items/.by.slug/{slug}/variations
Preview of all variations of an Item by slug.
Request
Path Parameters
-
slug: string
Slug value of the item to be previewed.
Query Parameters
-
channelToken(optional): string
Channel token of the targeted channel. A channel token must be provided as either a query parameter or a request header.
-
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.
Example: links=self,canonical will only return the links with the rel property self or canonical.
Response
Supported Media Types
- application/json
200 Response
Successful operation.
Nested Schema : VariationsInfo
Type:
object
Variations Info.
Show Source
-
items(optional):
array items
Content item variations.
-
links(optional):
array links
-
masterItem(optional):
string
Master item.
-
setId(optional):
string
Variation set id.
-
varType(optional):
string
Variation type name.
Nested Schema : items
Type:
array
Content item variations.
Show Source
-
Array of:
object Language
LanguageItem
Nested Schema : Language
Type:
object
LanguageItem
Show Source
-
id(optional):
string
id of the item.
-
links(optional):
array links
-
value(optional):
string
Language value
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.
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.
404 Response
The requested resource was not found.
500 Response
Internal server error. An unexpected error condition encountered in the system.
Examples
Example 1:
The following example shows how to preview variations of item with slug by submission of a GET request on the REST resource using cURL:
curl -X GET -H 'Accept: application/json' 'https://host:port/content/preview/api/v1.1/items/.by.slug/3000000000012-c1/variations?channelToken=37727fdc857c4d479513325888b69df0'
This reads preview of variations of item with slug: 3000000000012-c1, channelToken: 37727fdc857c4d479513325888b69df0.
Response Body
{ "data": [ { "varType": "language", "masterItem": "CORE96C8FDF1883C44AB908FC56FF618D225", "items": [ { "id": "CORE2824D7CF303F4C80BD765983B2BFDB33", "value": "es" }, { "id": "CORE96C8FDF1883C44AB908FC56FF618D225", "value": "en-US" } ] } ], "links": [ { "href": "https://<hostname>/content/preview/api/v1.1/items/.by.slug/3000000000012-c1/variations?channelToken=37727fdc857c4d479513325888b69df0", "rel": "self", "method": "GET", "mediaType": "application/json" } ] }
Example 2:
curl -X GET -H 'Accept: application/json' 'https://host:port/content/preview/api/v1.1/items/.by.slug/cdt-digital-asset/variations?channelToken=37727fdc857c4d479513325888b69df0'
This reads preview of variations of item with slug: cdt-digital-asset, channelToken: 37727fdc857c4d479513325888b69df0.
Response Body
{ "data": [ { "varType": "language", "masterItem": "CONTE626E01775F9477999908D3B1DD1BBDD", "items": [ { "id": "CONT7EB51110AF9A480DA200ABAD183B3B2B", "value": "es" }, { "id": "CONTE626E01775F9477999908D3B1DD1BBDD", "value": "en-US" } ] } ], "links": [ { "href": "https://<hostname>/content/preview/api/v1.1/items/.by.slug/cdt-digital-asset/variations?channelToken=37727fdc857c4d479513325888b69df0", "rel": "self", "method": "GET", "mediaType": "application/json" } ] } }