Render a CMS block

Prev Next
Post
/cmsBlocks/render

Substitutes the given variables into the block content. The body is optional. variables holds the values to substitute for this render only, as a JSON object serialized as a string, e.g. {"defaultBGColor": "#CCCCCC"}. Nothing is saved.

Query parameters
blockId
integer (int64) Required

The numeric ID of the block.

Body parameters

Optional. The variables to substitute in.

object
variables
string
Responses
200

The block with its content rendered.

Example response:

{
  "id": 9405,
  "name": "Welcome text",
  "content": "<p style=\"background-color: ${defaultBGColor}\">Welcome to our newsletter</p>",
  "renderedContent": "<p style=\"background-color: #CCCCCC\">Welcome to our newsletter</p>",
  "tags": "welcome,onboarding",
  "type": null,
  "usageArea": "BODY",
  "description": "Greeting used in onboarding mails",
  "contentStatus": "UNLOCKED",
  "encoding": "UTF-8",
  "lifecycleStatus": "ACTIVE",
  "folder": "Onboarding",
  "validationCode": "",
  "lastError": null
}
object
id
integer (int64)
name
string
content
string
renderedContent
string
tags
string
type
string
usageArea
string
description
string
contentStatus
string
Valid values[ "LOCKED", "UNLOCKED" ]
encoding
string
lifecycleStatus
string
Valid values[ "ACTIVE", "ARCHIVED" ]
folder
string
validationCode
string
lastError
string
400

Error. All errors are returned as HTTP 400; errorCode in the body says what went wrong: INVALID_PARAMETER or MISSING_PARAMETER (a parameter is missing or invalid), NO_SUCH_OBJECT (no object with this ID in your account), PERMISSION_DENIED (your user lacks the CMS permission for this action), UNEXPECTED_ERROR (backend error). Example: {"errorActor": "CLIENT", "errorCode": "NO_SUCH_OBJECT", "message": "...", "objectType": null, "propertyName": null, "propertyValue": null}