searchContent

Search your Marketing Cloud Next content workspace for content items.

GET https://{subdomain}.my.salesforce.com/services/data/v63.0/connect/cms/items/search

Request 

HTTP Request Example
1GET /services/data/v63.0/connect/cms/items/search?contentSpaceOrFolderIds=0Zu1Q0000000XyZSAU&queryTerm=Sales%20Campaign%202024&contentTypeFqn=sfdc_cms__image&scope=titleonly HTTP/1.1
2Host: {subdomain}.my.salesforce.com
3Authorization: Bearer YOUR_BEARER_TOKEN

URI Parameters 

subdomain (string)

Required. The unique API subdomain for your Salesforce org.

Headers 

Authorization (string)

Required. A unique, time-limited token that you can use to issue requests to Connect API. Replace YOUR_ACCESS_TOKEN with your authentication token.

1Bearer YOUR_ACCESS_TOKEN

Query Parameters 

contentSpaceOr​FolderIds (string)

Required. The ID of a managed content space or folder to search within.

queryTerm (string)

Required. The terms to search for in the workspace or folder. You can include up to 50 terms. Separate each term with a space. Search terms must contain at least two characters that aren’t wildcards.

contentTypeFQN (string)

The type of content to restrict the query to. For example, to search only images, specify sfdc_cms__image.

page (integer)

The page number of results to return. Page numbering begins at 0. The default value is 0.

pageSize (integer)

The number of items to return in each page of results. The minimum number is 1 and the maximum is 250. The default page size is 25.

languages (array of string)

A list of languages to include in the search. Specify each language as a language code, such as en, or as a language and locale, such as en_US. You can specify up to 10 languages, separating each with a space. Search returns only exact matches and only languages that the workspace supports. The default value is the default language for the workspace.

scope (string)

The fields that the query applies to. To search only content titles for the query string, specify titleOnly. To search all fields, specify All. The default value is All.

Responses 

200 OK

This response indicates that the API accepted your request to search content items.

1{
2    "count": 50,
3    "currentPageUri": "/services/data/v63.0/connect/cms/items/search?contentSpaceOrFolderIds=0Zu1Q0000000XyZSAU&queryTerm=Sales%20Campaign%202024&contentTypeFqn=sfdc_cms__image&scope=titleonly",
4    "items": [
5        {
6            "contentKey": "MCXRNIVRVVSBD23FOSGBFLSAXYZ4",
7            "contentType": {
8                "developerName": "sfdc_cms__image",
9                "label": "Image"
10            },
11            "createdBy": {
12                "id": "0051Q00000bwxY5QAI",
13                "name": "D'Angelo Cunningham",
14                "resourceUrl": "/services/data/v63.0/chatter/users/0051Q00000bwxY5"
15            },
16            "createdDate": "2024-01-22T21:01:07.000Z",
17            "folder": {
18                "id": "9Pu1Q0000000COQSA2",
19                "resourceUrl": "/services/data/v63.0/connect/cms/folders/9Pu1Q0000000COQ"
20            },
21            "id": "9Ps1Q000000l0DbSAI",
22            "language": {
23                "displayLabel": "English (default)",
24                "locale": "en_US"
25            },
26            "lastModifiedBy": {
27                "id": "0051Q00000bwxY5QAI",
28                "name": "D'Angelo Cunningham",
29                "resourceUrl": "/services/data/v63.0/chatter/users/0051Q00000bwxY5"
30            },
31            "lastModifiedDate": "2024-01-22T21:01:07.000Z",
32            "lastPublishedDate": "2024-01-22T21:01:07.000Z",
33            "managedContentId": "20Y1Q0000009KBTUA2",
34            "managedContentSpaceId": "0Zu1Q0000000XyZSAU",
35            "mimeType": "image/png",
36            "status": "Draft",
37            "title": "2024 Sales Campaign Hero Banner",
38            "type": "ManagedContentVariantSearchResultRepresentation",
39            "urlName": "herobanner",
40            "urlValue": "/cms/media/MCXRNIVRVVSBD23FOSGBFLSAXYZ4?version=1.1",
41            "variantType": "Content"
42        }
43        ...
44    ],
45    "nextPageUri": "/services/data/v63.0/connect/cms/items/search?page=1&pageSize=25&queryTerm=Sales%20Campaign%202024&contentTypeFqn=sfdc_cms__image&scope=titleonly"
46}
400 Bad Request

This response indicates that your request contained errors that prevented the search from completing. When you receive a 400 response, examine the request syntax for errors. This response can be returned if you specify an invalid contentSpaceOrFolderIds value in the query string.

1[
2  {
3    "errorCode": "INVALID_ID_FIELD",
4    "message": "The Library ID 0Zu1Q0000000XyZSAU is invalid. Specify a valid Library ID."
5  }
6]
401 Unauthorized

This response indicates that the API wasn’t able to authorize your request. When you receive a 401 response, verify that your authorization token is still valid.

1[
2  {
3    "message":"Session expired or invalid",
4    "errorCode":"INVALID_SESSION_ID"
5  }
6]

See Also