Channel Token and Authentication

Preview items resources allows to preview the assets in revision that are not published yet as if it is already published and is being accessed in published context together with other assets. These resources allows to preview the latest version of management items that are targeted to the specified channel. A channel token is required to access these resources. The channel token identifies the channel to which the item is targeted.

A valid channel token must be provided to access these resources. The channel token can be provided either as a query parameter or as a header of the same name. When no valid channelToken is present in the request, the resource produces response HTTP 403 Forbidden: Channel Token is incorrect or missing in the request.

Preview item resources (below) provide a variety of querying and expansion capabilities that a client can use in their application.

To access a preview resource:

  • Pass a channelToken value with your request.

  • Get authenticated before accessing the preview resource in the secure channel.

Get Channel Token

To get the channel token:

  1. Ensure you're already authenticated before using OAuth, see Authorization.

  2. Execute a GET request to the URL:

    https://Content Management URL/content/management/api/v1.1/channels

    Sample Response:

    The JSON response will contain the token for the respective published channel. For example, channel1 with ID RCHANNEL73166144CA54417294C002D4CC85FAAE.

    {
      "hasMore": false,
      "offset": 0,
      "count": 2,
      "limit": 2,
      "items": [
        {
          "id": "RCHANNEL73166144CA54417294C002D4CC85FAAE",
          "name": "channel1",
          "description": "",
          "createdBy": "User1",
          "createdDate": {
            "value": "2019-11-26T08:37:35.803Z",
            "timezone": "UTC"
          },
          "updatedBy": "User1",
          "updatedDate": {
            "value": "2019-11-26T08:37:35.803Z",
            "timezone": "UTC"
          },
          "isSiteChannel": false,
          "roleName": "manager",
          "links": [
            {
              "href": "http://myhost.us.example.com:7777/content/management/api/v1.1/channels/RCHANNEL73166144CA54417294C002D4CC85FAAE",
              "rel": "self",
              "method": "GET",
              "mediaType": "application/json"
            }
          ]
        },
        {
          "id": "RCHANNEL0E38831154DF4D848CED28979824F2D4",
          "name": "channel2",
          "description": "",
          "createdBy": "User1",
          "createdDate": {
            "value": "2019-11-26T08:54:58.129Z",
            "timezone": "UTC"
          },
          "updatedBy": "User1",
          "updatedDate": {
            "value": "2019-11-26T08:54:58.129Z",
            "timezone": "UTC"
          },
          "isSiteChannel": false,
          "roleName": "manager",
          "links": [
            {
              "href": "http://myhost.us.example.com:7777/content/management/api/v1.1/channels/RCHANNEL0E38831154DF4D848CED28979824F2D4",
              "rel": "self",
              "method": "GET",
              "mediaType": "application/json"
            }
          ]
        }
      ],
      "links": [
        {
          "href": "http://myhost.us.example.com:7777/content/management/api/v1.1/channels",
          "rel": "self",
          "method": "GET",
          "mediaType": "application/json"
        },
        {
          "href": "http://myhost.us.example.com:7777/content/management/api/v1.1/channels",
          "rel": "canonical",
          "method": "GET",
          "mediaType": "application/json"
        },
        {
          "href": "http://myhost.us.example.com:7777/content/management/api/v1.1/metadata-catalog/channels",
          "rel": "describedby",
          "method": "GET",
          "mediaType": "application/schema+json"
        },
        {
          "href": "http://myhost.us.example.com:7777/content/management/api/v1.1/channels?offset=0",
          "rel": "first",
          "method": "GET",
          "mediaType": "application/json"
        },
        {
          "href": "http://myhost.us.example.com:7777/content/management/api/v1.1/channels?offset=0",
          "rel": "last",
          "method": "GET",
          "mediaType": "application/json"
        }
      ]
    }
  3. Execute a GET request to the URL:
    https://Content Management URL/content/management/api/v1.1/channels/RCHANNEL73166144CA54417294C002D4CC85FAAE

    The JSON response will contain the token for the respective published channel. For example, efe506cee46d451bb31d1c36e12e5b71 is the channelToken for the channel1 having ID RCHANNEL0E38831154DF4D848CED28979824F2D4.

    {
      "id": "RCHANNEL0E38831154DF4D848CED28979824F2D4",
      "name": "Test10680223023446802",
      "description": "",
      "createdBy": "User1",
      "createdDate": {
        "value": "2019-11-26T08:54:58.129Z",
        "timezone": "UTC"
      },
      "updatedBy": "User1",
      "updatedDate": {
        "value": "2019-11-26T08:54:58.129Z",
        "timezone": "UTC"
      },
      "channelType": "public",
      "isSiteChannel": false,
      "publishPolicy": "anythingPublished",
      "localizationPolicy": "",
      "channelTokens": [
        {
          "name": "defaultToken",
          "token": "efe506cee46d451bb31d1c36e12e5b71",
          "expirationDate": {
            "value": "2099-01-01T12:00:00.000Z",
            "timezone": "UTC"
          }
        }
      ],
      "roleName": "manager",
      "links": [
        {
          "href": "http://myhost.us.example.com:7777/content/management/api/v1.1/channels/RCHANNEL0E38831154DF4D848CED28979824F2D4",
          "rel": "self",
          "method": "GET",
          "mediaType": "application/json"
        },
        {
          "href": "http://myhost.us.example.com:7777/content/management/api/v1.1/channels/RCHANNEL0E38831154DF4D848CED28979824F2D4",
          "rel": "canonical",
          "method": "GET",
          "mediaType": "application/json"
        },
        {
          "href": "http://myhost.us.example.com:7777/content/management/api/v1.1/metadata-catalog/channels/RCHANNEL0E38831154DF4D848CED28979824F2D4",
          "rel": "describedby",
          "method": "GET",
          "mediaType": "application/schema+json"
        }
      ]
    }

Get Authenticated

To get authenticated before accessing the preview resource in the secure channel:

Method 1: See Authorization.

Method 2:
  1. To generate a channel secret, see Channel Secret REST Endpoints.
  2. To get an OAuth token using the channel secret, see Generate an OAuth Token.