Search CMS Content with a Connected App
Use the Connect REST API’s CMS delivery search resource to retrieve CMS content that matches a text search with a connected app. If the request is successful, the response contains a JSON object with the selected content.
To form the API request, you need these items.
- A CMS access token
- A CMS channel ID that has access to the content
To send an API call to get CMS content, make an HTTP GET request to the /services/data/v{XX.X}/connect/cms/delivery/channels/{channelId}/contents/search
resource. Append the queryTerm
request parameter, and set its value to the term you want to search for.
For example, this sample URL selects content with the term “fish” from the channel with an ID of 0ap5w000000kcaiAAA
.
Include an Authorization header with the value Bearer {access_token}
, where access_token is your CMS access token. Optionally, specify the response format with a Content-Type header.
This Node.js sample requests CMS content from the channel ID stored in the config.channelId
variable and limits the results to content that contains the text stored in the searchTerm
variable.
In response to the API request, the API returns an HTTP response code and a JSON body with an object containing all the selected content and pagination details.
This sample shows the response from the previous sample request to retrieve content that contains the word “fish”.