Channel Token and Authentication
Published items resources provide access to published items of a specified published channel. A channel token is required to access these resources. The channel token identifies the published channel to which the item is published.
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.
Published item resources (below) provide a variety of querying and expansion capabilities that a client can use in their application.
To access a published resource:
-
Pass a channelToken value with your request.
-
Get authenticated before accessing the published resource in the secure channel.
Get Channel Token
To get the channel token channelToken
:
-
Ensure you're already authenticated before using OAuth: http://docs.oracle.com/en/cloud/paas/content-cloud/rest-api-manage-content/Authorization.html
-
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" } ] }
- 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 thechannelToken
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 published resource in the secure channel:
Method 1: See http://docs.oracle.com/en/cloud/paas/content-cloud/rest-api-manage-content/Authorization.html.
- To generate a channel secret, see Channel Secret REST Endpoints.
- To get an OAuth token using the channel secret, see Generate an OAuth Token.