Get Preview of an Item by slug

get

/content/published/api/v1.1/items/.by.slug/{slug}/preview

Previews the latest management version of the item by its slug value that is ready for publish or published. An item is uniquely identified by its slug.
Note: This API requires authentication to preview the item.

Each preview item has the following information:
  1. Standard fields: These are fields created by the system.
    • id: ID of the item.
    • type: Type of the item.
    • name: Name of the item.
    • typeCategory: Category of the type.
    • description: Description of the item.
    • slug : A URL part that identifies content item in human-readable format.
    • language : Language of the Item.
    • createdDate: First published date of the item on the channel requested.
    • updatedDate: Last published date of the item on the channel requested.
  2. User-defined fields: These are fields created by the user when the type is defined. All user fields are available under the fields node.

  3. Request Headers (Optional):
    Header NameHeader Value
    channelToken{valid channel token value}
    Acceptapplication/json

Request

Path Parameters
Query Parameters
  • Channel token of the publish target. A channel token must be provided as either a query parameter or a request header.
  • Expand parameter provides the option of getting child resources (referenced items) inline with the item's response. 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 (.). If these fields are of a reference type, then the resource expands their data inline in the response. Field names are case-sensitive. When expand is specified as all (in lowercase), all the fields of the reference type of the requested item are expanded. When expand is not specified, the item response contains links to the referenced items.
    Expansion of this form is supported for one level only, a request to expand beyond the first level of referenced fields will produce response HTTP 400. When the expand contains a nonexisting field as per the type definition of the requested item, the resource produces HTTP 400.
    Examples:
      expand=fields.field1,fields.field2
      expand=all
    where field1, field2 are names of the user-defined fields in the type to which this item belongs.
Back to Top

Response

Supported Media Types

200 Response

Successful operation.
Body ()
Root Schema : Item
Type: object
Item.
Show Source
Nested Schema : createdDate
Type: object
Created date of the item. Map having value, timezone, and description
Nested Schema : fields
Type: object
Additional Properties Allowed
Show Source
User-defined fields data. Map
Nested Schema : itemVariations
Type: array
Show Source
Nested Schema : RenditionsBean
Type: object
Show Source
Nested Schema : TaxonomiesBean
Type: object
Show Source
Nested Schema : updatedDate
Type: object
Last updated date of the item. Map having value, timezone, and description
Nested Schema : additionalProperties
Type: object
Nested Schema : ItemVariation
Type: object
Show Source
Nested Schema : items
Type: array
Item renditions.
Show Source
Nested Schema : RenditionBean
Type: object
Show Source
Nested Schema : formats
Type: array
Show Source
Nested Schema : RenditionFormatBean
Type: object
Show Source
Nested Schema : items
Type: array
Item taxonomies.
Show Source
Nested Schema : TaxonomyItem
Type: object
TaxonomyItem
Show Source
Nested Schema : TaxonomyCategories
Type: object
CategoriesBean
Show Source
Nested Schema : items
Type: array
Taxonomy Categories
Show Source
Nested Schema : CategoryItem
Type: object
CategoryItem
Show Source
Nested Schema : nodes
Type: array
The nodes of the category assigned to the item.
Show Source
Nested Schema : CategoryNodeItem
Type: object
CategoryNodeBean
Show Source

304 Response

Not changed. The request honors requests with e-tag.

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.
Back to Top

Examples

The following example shows how to preview published item.

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

This reads preview of published item with slug: 1481786137093-test615584261331002_item1.

/content/published/api/v1.1/items/.by.slug/1481786137093-test615584261331002_item1/preview

Response Body

{
        "id": "CORE9D311792F96B44D480505B9356BF85B6",
        "type": "Test615486605533000",
        "name": "Test615584261331002_item1",
        "description": "Test615584261395003_item1_desc",
        "typeCategory": "ContentType",
        "slug": "1481786137093-test615584261331002_item1",
        "language": "en",
        "translatable": false,
        "createdDate": {
          "value": "2020-07-03T09:56:06.065Z",
          "timezone": "UTC"
        },
        "updatedDate": {
          "value": "2020-07-03T09:56:07.127Z",
          "timezone": "UTC"
        },
        "fields": {
          "615485847566005Float_Single": 2.3,
          "615485847886008Reference_Single": {
            "id": "CONT689B06DD7FF945EDA2C118AE6958832E",
            "type": "DigitalAsset",
            "name": "audi1_1593770161812.jpg",
            "typeCategory": "DigitalAssetType",
            "links": [
              {
                "href": "https://<hostname>/content/published/api/v1.1/items/CONT689B06DD7FF945EDA2C118AE6958832E",
                "rel": "self",
                "method": "GET",
                "mediaType": "application/json"
              }
            ]
          },
          "615485847117002String_List": [
            "sample1",
            "sample2"
          ],
          "615485848155009Reference_List": [
            {
              "id": "CORE74BAB37DCB14487DBA7C0206580C1FE1",
              "type": "Test615524669505002",
              "name": "Test615562696749006_item1",
              "typeCategory": "ContentType",
              "links": [
                {
                  "href": "https://<hostname>/content/published/api/v1.1/items/.by.slug/1481786137043-test615562696749006_item1",
                  "rel": "self",
                  "method": "GET",
                  "mediaType": "application/json"
                }
              ]
            },
            {
              "id": "CORE58BE978F62FD47A984960B273D19FE61",
              "type": "Test615524669505002",
              "name": "Test615568776605008_item2",
              "typeCategory": "ContentType",
              "links": [
                {
                  "href": "https://<hostname>/content/published/api/v1.1/items/.by.slug/1481786137050-test615568776605008_item2",
                  "rel": "self",
                  "method": "GET",
                  "mediaType": "application/json"
                }
              ]
            }
          ],
          "615485847348003Int_Single": 13,
          "615485747694001String_Single": "sample",
          "615485847674006Float_List": [
            1.4,
            5.4
          ],
          "615485847466004Int_List": [
            14,
            54
          ],
          "615485847774007Boolean_Single": false
        },
        "links": [
          {
            "href": "https://<hostname>/content/published/api/v1.1/items/.by.slug/1481786137093-test615584261331002_item1/preview",
            "rel": "self",
            "method": "GET",
            "mediaType": "application/json"
          },
          {
            "href": "https://<hostname>/content/published/api/v1.1/items/.by.slug/1481786137093-test615584261331002_item1/preview",
            "rel": "canonical",
            "method": "GET",
            "mediaType": "application/json"
          },
          {
            "href": "https://<hostname>/content/published/api/v1.1/metadata-catalog/items/.by.slug/1481786137093-test615584261331002_item1/preview",
            "rel": "describedby",
            "method": "GET",
            "mediaType": "application/schema+json"
          }
        ]
      }
Back to Top