You are here:
JSON File Format for Content in Salesforce CMS
Understand the content details from an export, then define your content details in JSON format to import content into a CMS workspace.
Required Editions
| Available in: Lightning Experience |
| Available in: Enterprise, Performance, Unlimited, and Developer Editions |
Content Properties
The format of the JSON file depends on the content type—image, news, or custom content. Each one has different properties.
Here’s an example of the JSON structure for
importing mixed content items in an array.
{
"content": [{
"contentKey": "MC4NFMB52LHFFWPNFNKHQJHLFBQM",
"type": "cms_image",
"urlName": "content1a",
"body": {
"title": "My Image",
"altText": "My Image",
"thumbUrl": "https://encrypted-tbn0.gstatic.com/images?q=R3RYwZIUV6wo_tQ&usq=CA",
"source": {
"url": "https://encrypted-tbn0.gstatic.com/images?q=R3RYwZIUV6wo_tQ&usq=CA}"
}
}
},
{
"contentKey": "MC4NFMB52LHFFWPNFNKHQKJLMNFR",
"type": "news",
"urlName": "content2a",
"body": {
"title": "My News Item",
"body": "<p>This is the body of my news item, which includes an uploaded banner image.</p>",
"bannerImage": {
"ref": "MCFQ2WJD3O6NGCXOI3DIOF4RJQOI"
},
"excerpt": "This is a summary of my news item."
}
}
]
}| Field Name | Type | Description |
|---|---|---|
body |
body |
Required. Includes properties that define the body of the content item. Body properties differ by content type. |
contentKey |
string | A unique identifier generated by Salesforce CMS. This field isn’t required for import, but if it’s omitted or left empty, a new content key is assigned to the content after import. Content exported from Salesforce CMS includes this identifier. |
type |
string | Required. Defines the content type. Valid values depend on the content type.
|
urlName |
string | Optional. Text for the link to the URL. Valid format:
|
cms_image Body Properties
The
cms_image type has these body properties.
| Field Name | Type | Description |
|---|---|---|
altText |
string | Optional. Accessibility text to describe the content. |
source |
source | Required. An image node (IMG). |
thumbUrl |
string | Optional. URL address of the thumbnail image. |
title |
string | Required. The title of the content item. This node is a name field (NAMEFIELD). |
source
The
source field represents an image node (IMG) within the cms_image content type. At least one source field is
required.
| Field Name | Type | Description |
|---|---|---|
ref |
string | Required. File path of the image in the media folder of the .zip archive, or the content key of the image. |
url |
string | Required. URL address of the image. Valid URL bases are http:// or https://. |
Here’s an example of the JSON structure
for importing several images in an array. Salesforce CMS assigns a content key to new
content after import.
{
"content": [{
"type": "cms_image",
"urlName": "lampplus",
"body": {
"title": "Uttermost Rovasenda Pale Mint Green Ceramic Table Lamp",
"altText": "Uttermost Rovasenda Pale Mint Green Ceramic Table Lamp",
"thumbUrl": "https://encrypted-tbn0.gstatic.com/images?q=R3RYwZIUV6wo_tQ&usq=CA",
"source": {
"url": "https://encrypted-tbn0.gstatic.com/images?q=R3RYwZIUV6wo_tQ&usq=CA}"
}
}
},
{
"type": "cms_image",
"urlName": "lampplus",
"body": {
"title": "Modern Table Lamps Set of 2 with USB Gold Metal for Living Room Bedroom Bedside",
"altText": "Modern Table Lamps Set of 2 with USB Gold Metal for Living Room Bedroom Bedside",
"thumbUrl": "https://myimageurl.com/images/g/wP8AAOSw3S1ct-iC/s-l640.jpg",
"source": {
"url": "https://myimageurl.com/images/g/wP8AAOSw3S1ct-iC/s-l640.jpg"
}
}
},
{
"type": "cms_image",
"urlName": "lampplus",
"body": {
"title": "Hanging Pendant Lamp with Bluetooth Accessibility",
"altText": "Hanging Pendant Lamp with Bluetooth Accessibility",
"source": {
"ref": "SummerCampaign/Sale/hangingpendantlamp.png"
}
}
}
]
}news Body Properties
The news type has these body properties.
| Field Name | Type | Description |
|---|---|---|
bannerImage |
bannerImage | Optional. An image node (IMG) to
display a graphic as a banner in the news item. |
body |
string | Optional. A rich text node ( Can also include references to the Salesforce managed content ID (MCID) or content key of an image. The graphic for this reference must be imported and available in Salesforce CMS before the news content piece can be imported. |
excerpt |
string | Optional. Used to summarize the news piece. This node is a multi-line text
(MTEXT). |
bannerImage
The
bannerImage field represents an image node
(IMG) within the news content type.
| Field Name | Type | Description |
|---|---|---|
ref |
string | Optional. Salesforce managed content ID (MCID) or content key of an image. The graphic for this reference must be imported and available in Salesforce CMS before the news content piece can be imported. |
Here’s an example of the JSON structure for a news item that references an image by using the image’s content key.
{
"content":[
{
"contentKey":"MC4NFMB52LHFFWPNFNKHQJHLFBQM",
"type":"news",
"urlName":"content1a",
"body":{
"title":"Content1",
"body":"<p>This is body with uploaded banner1.<\/p>",
"bannerImage": {
"ref":"MCFQ2WJD3O6NGCXOI3DIOF4RJQOI"
},
"excerpt":"This is a summary of my news item."
}
}]
}Here’s an example of the JSON structure for a news item that references an image in the rich text editor (RTE).
{
"content": [{
"contentKey": "MC4NFMB52OSDINTHIFEGINBVWTHY",
"type": "news",
"urlName": "content2a",
"body": {
"title": "Content 2",
"body": "<p>This is body with an image reference inline.<\/p> <p><br><\/p> <p><img data-fileid=\"20YRM0000004MyW\" data-cms-filename=\"SalesforceLogo.png\"><\/img><\/p> <iframe frameborder=\"0\" scrolling=\"auto\" allowfullscreen=\"true\" src=\"https:\/\/www.youtube.com\/embed\/X1XM4PwKVn0?showinfo=0\" width=\"560px\" height=\"315px\"><\/iframe> <p><br><\/p>",
"excerpt": "This is a summary of my news item."
}
}]
}Here’s an example of the JSON structure for a news item that references an image by using the content key in the rich text editor (RTE).
{
"content": [{
"contentKey": "MC8HYNJ89QAZXSWEDCVFRTGBNHYU",
"type": "news",
"urlName": "content3a",
"body": {
"title": "Content 3",
"body": "<img src=’ ‘ data-contentKey=’ ‘MCFQ2WJD3O6NGCXOI3DIOF4RJQOI’>",
"excerpt": "This excerpt is a summary of my news item."
}
}]
}
Custom Content Body Properties
Your content needs a name, but the rest of the content type properties are up to you. You can set any nodes depending on the type of content that you want to import. Here are some example properties.
| Example Field Name | Type | Description |
|---|---|---|
dateNode |
string | Optional. Date node (DATE). Valid format is
yyyy-MM-dd. |
dateTimeNode |
dateTimeNode | Optional. Datetime node (DATETIME). Defines the
body of the date, time, and time zone of the content. |
nameNode |
string | Required. The name field node (NAMEFIELD) is a
free text field. |
urlNode |
string | Optional. URL address of the content. |
dateTimeNode
The dateTimeNode
field represents a managed content date and time node (DateTime)
within the custom content type.
| Field Name | Type | Description |
|---|---|---|
dateTimeValue |
string | Optional. Valid format is yyyy-MM-dd'T'HH:mm:ss.SSS'Z' (UTC datetime in ISO 8601 format). Valid format for the date is YYYY-MM-DD. Valid format for the time is 24-hour style. |
timeZone |
string | Optional. Valid format is Country/City. |
Here’s an example of the JSON structure for importing a custom content item. Salesforce CMS assigns a content key after import.
{
"content": [{
"type": "customContentType",
"body": {
"nameNode": "CustomContentImportTest",
"urlNode": "http://www.exampletube.com/myVideo",
"dateNode": "1994-07-01",
"dateTimeNode": {
"dateTimeValue": "2008-09-15T15:53:00.000Z",
"timeZone": "America/Los_Angeles"
}
}
}]
}
