Add Text CMS Content to Marketing Cloud
Use the Marketing Cloud API’s content assets resource to add text CMS content to Marketing Cloud in a connected app. If the request is successful, the content is then available in Content Builder.
To form the API request, you need these items.
- A Marketing Cloud access token
- The JSON object exported from CMS that contains the text CMS content that you want to import to Marketing Cloud
- The category ID of the folder in Content Builder where you want Marketing Cloud to save the content
To send an API call to add text CMS content to Marketing Cloud, make an HTTP POST request to the /asset/v1/content/assets
resource.
Include an Authorization header with the value Bearer {access_token}
, where access_token is your CMS access token.
In the request body, create a JSON object with these fields.
-
name
—A string that contains the name of the content. -
assetType
—An object containing theid
field with a numeric value of196
. 196 is the asset type for text blocks. -
content
—The JSON object for the text CMS content. -
category
—An object that contains theid
field with a string value. Set the value to the category ID of the Content Builder folder where you want Marketing Cloud to save the content.
For more information on the request and response format for this resource, see Marketing Cloud API: REST API v1 Reference.
This Node.js sample adds text CMS content to Marketing Cloud. The currentNode
variable contains the JSON object of the CMS content.
In response to the API request, the API returns an HTTP response code and a JSON body with an object representing the newly created asset in Marketing Cloud. For details on the response object and possible HTTP response codes, see Marketing Cloud API: REST API v1 Reference.