Preview an item by slug

get

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

Previews the latest management version of the item by slug value that is ready for publishing or published. An item is uniquely identified by slug.
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 the item in human-readable format.
    • language : Language of the Item.
    • createdDate: Created date of the item on the channel requested.
    • updatedDate: Updated 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 :
    Is requiredHeader NameHeader Value
    RequiredchannelToken{valid channel token value}
    OptionalAcceptapplication/json

Request

Path Parameters
Query Parameters
  • Channel token of the targeted channel. 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 non-existing 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

Example 1:

The following example shows how to preview latest management item 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?channelToken=37727fdc857c4d479513325888b69df0'

This reads preview of item with slug: 3000000000012-c1, channelToken: 37727fdc857c4d479513325888b69df0.

Response Body

{
        "id": "CORE96C8FDF1883C44AB908FC56FF618D225",
        "type": "custitem",
        "typeCategory": "ContentType",
        "name": "c1",
        "description": "",
        "slug": "3000000000012-c1",
        "language": "en-US",
        "translatable": true,
        "createdDate": {
          "value": "2021-09-16T04:06:07.066Z",
          "timezone": "UTC"
        },
        "updatedDate": {
          "value": "2021-09-16T04:45:11.903Z",
          "timezone": "UTC"
        },
        "fileExtension": "contentItem",
        "fields": {
          "profession": "cricket",
          "title": "batter"
        },
        "mimeType": "contentItem",
        "fileGroup": "contentItem",
        "links": [
          {
            "href": "https://<hostname>/content/preview/api/v1.1/items/.by.slug/3000000000012-c1?channelToken=37727fdc857c4d479513325888b69df0",
            "rel": "self",
            "method": "GET",
            "mediaType": "application/json"
          },
          {
            "href": "https://<hostname>/content/preview/api/v1.1/items/.by.slug/3000000000012-c1?channelToken=37727fdc857c4d479513325888b69df0",
            "rel": "canonical",
            "method": "GET",
            "mediaType": "application/json"
          },
          {
            "href": "https://<hostname>/content/preview/api/v1.1/metadata-catalog/items/.by.slug/3000000000012-c1?channelToken=37727fdc857c4d479513325888b69df0",
            "rel": "describedby",
            "method": "GET",
            "mediaType": "application/schema+json"
          }
        ]
      }

Example 2:

curl -X GET -H 'Accept: application/json' 'https://host:port/content/preview/api/v1.1/items/.by.slug/cdt-digital-asset?channelToken=f573b68c764a44f9bae0627140d8b0bd'

This reads preview of item with slug: cdt-digital-asset, channelToken: f573b68c764a44f9bae0627140d8b0bd.

Response Body

{
        "id": "CONT3E3AFF31343940768BEBE5461F97A8BC",
        "type": "DigitalAsset",
        "name": "Test522387760830005.jpg",
        "description": "",
        "slug": "cdt-digital-asset",
        "language": "en-US",
        "typeCategory": "DigitalAssetType",
        "createdDate": {
          "value": "2020-07-03T07:22:31.732Z",
          "timezone": "UTC"
        },
        "updatedDate": {
          "value": "2020-07-03T07:22:31.732Z",
          "timezone": "UTC"
        },
        "fileExtension": "jpg",
        "fields": {
          "metadata": {
            "width": "5",
            "height": "5"
          },
          "size": 631,
          "native": {
            "links": [
              {
                "href": "https://<hostname>/content/preview/assets/cdt-digital-asset/native/Test522387760830005.jpg?channelToken=f573b68c764a44f9bae0627140d8b0bd",
                "rel": "self",
                "method": "GET",
                "mediaType": "image/jpeg"
              }
            ]
          },
          "renditions": [
            {
              "name": "Thumbnail",
              "formats": [
                {
                  "format": "jpg",
                  "size": 631,
                  "mimeType": "image/jpeg",
                  "metadata": {
                    "width": "5",
                    "height": "5"
                  },
                  "links": [
                    {
                      "href": "https://<hostname>/content/preview/assets/cdt-digital-asset/Thumbnail/Test522387760830005.jpg?format=jpg&type=responsiveimage&channelToken=f573b68c764a44f9bae0627140d8b0bd",
                      "rel": "self",
                      "method": "GET",
                      "mediaType": "image/jpeg"
                    }
                  ]
                },
                {
                  "format": "webp",
                  "size": 0,
                  "mimeType": "image/webp",
                  "metadata": {
                    "width": "5",
                    "height": "5"
                  },
                  "links": [
                    {
                      "href": "https://<hostname>/content/preview/assets/cdt-digital-asset/Thumbnail/Test522387760830005.jpg?format=webp&type=responsiveimage&channelToken=f573b68c764a44f9bae0627140d8b0bd",
                      "rel": "self",
                      "method": "GET",
                      "mediaType": "image/webp"
                    }
                  ]
                }
              ],
              "type": "responsiveimage"
            },
            {
              "name": "Medium",
              "formats": [
                {
                  "format": "jpg",
                  "size": 631,
                  "mimeType": "image/jpeg",
                  "metadata": {
                    "width": "5",
                    "height": "5"
                  },
                  "links": [
                    {
                      "href": "https://<hostname>/content/preview/assets/cdt-digital-asset/Medium/Test522387760830005.jpg?format=jpg&type=responsiveimage&channelToken=f573b68c764a44f9bae0627140d8b0bd",
                      "rel": "self",
                      "method": "GET",
                      "mediaType": "image/jpeg"
                    }
                  ]
                },
                {
                  "format": "webp",
                  "size": 0,
                  "mimeType": "image/webp",
                  "metadata": {
                    "width": "5",
                    "height": "5"
                  },
                  "links": [
                    {
                      "href": "https://<hostname>/content/preview/assets/cdt-digital-asset/Medium/Test522387760830005.jpg?format=webp&type=responsiveimage&channelToken=f573b68c764a44f9bae0627140d8b0bd",
                      "rel": "self",
                      "method": "GET",
                      "mediaType": "image/webp"
                    }
                  ]
                }
              ],
              "type": "responsiveimage"
            },
            {
              "name": "Large",
              "formats": [
                {
                  "format": "jpg",
                  "size": 631,
                  "mimeType": "image/jpeg",
                  "metadata": {
                    "width": "5",
                    "height": "5"
                  },
                  "links": [
                    {
                      "href": "https://<hostname>/content/preview/assets/cdt-digital-asset/Large/Test522387760830005.jpg?format=jpg&type=responsiveimage&channelToken=f573b68c764a44f9bae0627140d8b0bd",
                      "rel": "self",
                      "method": "GET",
                      "mediaType": "image/jpeg"
                    }
                  ]
                },
                {
                  "format": "webp",
                  "size": 0,
                  "mimeType": "image/webp",
                  "metadata": {
                    "width": "5",
                    "height": "5"
                  },
                  "links": [
                    {
                      "href": "https://<hostname>/content/preview/assets/cdt-digital-asset/Large/Test522387760830005.jpg?format=webp&type=responsiveimage&channelToken=f573b68c764a44f9bae0627140d8b0bd",
                      "rel": "self",
                      "method": "GET",
                      "mediaType": "image/webp"
                    }
                  ]
                }
              ],
              "type": "responsiveimage"
            },
            {
              "name": "Small",
              "formats": [
                {
                  "format": "jpg",
                  "size": 631,
                  "mimeType": "image/jpeg",
                  "metadata": {
                    "width": "5",
                    "height": "5"
                  },
                  "links": [
                    {
                      "href": "https://<hostname>/content/preview/assets/cdt-digital-asset/Small/Test522387760830005.jpg?format=jpg&type=responsiveimage&channelToken=f573b68c764a44f9bae0627140d8b0bd",
                      "rel": "self",
                      "method": "GET",
                      "mediaType": "image/jpeg"
                    }
                  ]
                },
                {
                  "format": "webp",
                  "size": 0,
                  "mimeType": "image/webp",
                  "metadata": {
                    "width": "5",
                    "height": "5"
                  },
                  "links": [
                    {
                      "href": "https://<hostname>/content/preview/assets/cdt-digital-asset/Small/Test522387760830005.jpg?format=webp&type=responsiveimage&channelToken=f573b68c764a44f9bae0627140d8b0bd",
                      "rel": "self",
                      "method": "GET",
                      "mediaType": "image/webp"
                    }
                  ]
                }
              ],
              "type": "responsiveimage"
            }
          ],
          "mimeType": "image/jpeg",
          "fileType": "jpeg"
        },
        "links": [
          {
            "href": "https://<hostname>/content/preview/api/v1.1/items/.by.slug/cdt-digital-assetchannelToken=f573b68c764a44f9bae0627140d8b0bd",
            "rel": "self",
            "method": "GET",
            "mediaType": "application/json"
          },
          {
            "href": "https://<hostname>/content/preview/api/v1.1/items/.by.slug/cdt-digital-asset?channelToken=f573b68c764a44f9bae0627140d8b0bd",
            "rel": "canonical",
            "method": "GET",
            "mediaType": "application/json"
          },
          {
            "href": "https://<hostname>/content/preview/api/v1.1/metadata-catalog/items/.by.slug/cdt-digital-asset?channelToken=f573b68c764a44f9bae0627140d8b0bd",
            "rel": "describedby",
            "method": "GET",
            "mediaType": "application/schema+json"
          }
        ]
      }
    }
Back to Top