Content Block

Overview

The Content Block endpoint allows you to manage your Content Blocks, by creating new Content Blocks, or by requesting information about or updating existing Content Blocks.

Content Blocks can also be created from the Content Blocks screen, or from the New Item screen.

For more details on how to set up a Content Block API request, please see the Content Block API Technical Guide.

GET Methods

The Content Block endpoint supports the following GET operations. These operations are intended to retrieve information about an existing Content Block.

Retrieve a Content Block

This endpoint allows you to retrieve information about a specified Content Block by providing its Object Reference ID. The response message will include all of the Content Block's format versions (HTML, Plain Text, etc.).  

 

Click hereClick here to see a sample response message in JSON format.

{

  "cont_id": 12345,

  "cont_name": "Test content block",

  "cust_id": 394,

  "entity_id": 100,

  "type_id": "PARAGRAPH",

  "view_id": 1002,

  "contBodies": [

    {

      "cont_id": 43884,

      "type_id": "TEXT",

      "usage_mask": "EMAIL, WEB, REPORT_SOCIAL_MASK",

      "body": "This is my Plain Text content."

    },

    {

      "cont_id": 43884,

      "type_id": "HTML",

      "usage_mask": "ALL_EMAIL_STYLE_USAGE_MASK",

      "body": "This is my HTML content. "

    }

  ],

  "contModelProps": [],

  "contParts": [],

  "obj": {

    "obj_id": 39695,

    "display_name": "Test content block",

    "type_id": "ContentBlock",

    "ref_id": 43884,

    "parent_obj_id": 37249,

    "eligibility_status_id": "READY"

  }

}

 

Retrieve All Associated Campaigns

This endpoint allows you to retrieve a list of all email and SMS text Campaigns that use a specified Content Block by providing its Object Reference ID. The response message will include the Object Reference IDs for all Campaigns that use this Content Block.

 

Click hereClick here to see a sample response message in JSON format.

[

45678,

44556

]

 

 

Retrieve Changed Campaigns

After you make changes to a Content Block, you can optionally push those changes out to any launched (but not yet finished deploying) Campaigns that utilize this Content Block. This feature runs the "Pick Up Changes" process on the Campaigns you select. When running "Pick Up Changes," the platform suspends the current version of the Campaign, copies it into a new version, applies the updated content, then launches that new version containing the updated content. All messages not yet deployed will be updated to include the changes (the platform doesn't modify messages that were deployed prior to running Pick Up Changes).

This endpoint allows you to retrieve a list of all email and SMS text Campaigns that use a specified Content Block, and that have unapplied changes in a launched Campaign. You must provide the Object Reference ID for the desired Content Block. The response message will include the Object Reference IDs for all Campaigns that are eligible for the Pick Up Changes process. You can utilize the PUT method described below to actually execute the Pick Up Changes process on these Campaigns.

 

Click hereClick here to see a sample response message in JSON format.

[

45678,

44556

]

 

 

POST Methods

The Content Block endpoint supports the following POST operations. These operations are intended to create a Content Block, or to use the platform's built-in HTML formatting tools on an existing Content Block.

Create a Content Block

This endpoint allows you to create a new Content Block by providing the following minimum information:

Click hereClick here to see a sample request message in JSON format.

{

  "cust_id": 394,

  "entity_id": 100,

  "type_id": "PARAGRAPH",

  "contBodies":

    [

      {

      "type_id": "HTML",

      "usage_mask": "ALL_EMAIL_STYLE_USAGE_MASK",

      "body": "<html> <body> HTML Message content goes here. </body> </html>"

      },

      {

      "type_id": "TEXT",

      "usage_mask": "EMAIL",

      "body": "Plain Text message content goes here."

      }

    ],

  "contModelProps": [],

  "contParts": [],

  "obj":

    {

    "display_name": "API Content Block",

    "parent_obj_id": 37249

    }

}

 

 

Click hereClick here to see a sample response message in JSON format.

{

  "cont_id": 52431,

  "cont_name": "Test Content Block",

  "cust_id": 123,

  "entity_id": 100,

  "type_id": "PARAGRAPH",

  "view_id": 1002,

  "contBodies": [

    {

      "cont_id": 52431,

      "type_id": "HTML",

      "usage_mask": "ALL_EMAIL_STYLE_USAGE_MASK",

      "body": "HTML message content here"

    }

  ],

  "contModelProps": [],

  "contParts": [],

  "obj": {

    "obj_id": 45657,

    "display_name": "Test Content Block",

    "type_id": "ContentBlock",

    "ref_id": 52431,

    "parent_obj_id": 11440,

    "eligibility_status_id": "READY"

  }

}

 

Convert HTML to Text

The Advanced Editor that's built into the Messaging application features an HTML-to-Text converter that strips out the HTML tags from the HTML format version of a Content Block, in order to make a Plain Text format version (see Entering Content for more details on this feature). This endpoint allows you to execute the HTML-to-Text converter via an API request message, on a specified Content Block. The request message must include the Content Block's Object Reference ID, and the Usage Mask for the HTML format version.

 

Click hereClick here to see a sample response message in JSON format.

The following example shows the new "TEXT" format version that was created by the system, based on the content of the "HTML" format version.

 

{

  "cont_id": 12345,

  "cont_name": "Test content block",

  "cust_id": 123,

  "entity_id": 100,

  "type_id": "PARAGRAPH",

  "view_id": 1002,

  "contBodies": [

    {

      "cont_id": 12345,

      "type_id": "TEXT",

      "usage_mask": "ALL_EMAIL_STYLE_USAGE_MASK",

      "body": "Hello, this is my test Content Block."

    },

    {

      "cont_id": 12345,

      "type_id": "HTML",

      "usage_mask": "ALL_EMAIL_STYLE_USAGE_MASK",

      "body": "Hello, this is my test Content Block."

    }

  ],

  "contModelProps": [],

  "contParts": [],

  "obj": {

    "obj_id": 39695,

    "display_name": "Test content block",

    "type_id": "ContentBlock",

    "ref_id": 12345,

    "parent_obj_id": 37249,

    "eligibility_status_id": "READY"

  }

}

 

 

Convert CSS Styles to Inline Styles

The Advanced Editor that's built into the Messaging application features a style converter that converts Cascading Style Sheet styles into inline HTML tags (see Entering Content for more details on this feature). This endpoint allows you to execute the style converter via an API request message, on a specified Content Block. The request message must include the Content Block's Object Reference ID, and Usage Mask for the desired format version.

 

Click hereClick here to see a sample response message in JSON format.

{

  "cont_id": 12345,

  "cont_name": "Test content block",

  "cust_id": 123,

  "entity_id": 100,

  "type_id": "PARAGRAPH",

  "view_id": 1002,

  "contBodies": [

    {

      "cont_id": 12345,

      "type_id": "TEXT",

      "usage_mask": "ALL_EMAIL_STYLE_USAGE_MASK",

      "body": "Hello, this is my test Content Block."

    },

    {

      "cont_id": 12345,

      "type_id": "HTML",

      "usage_mask": "ALL_EMAIL_STYLE_USAGE_MASK",

      "body": "Hello, this is my test Content Block."

    }

  ],

  "contModelProps": [],

  "contParts": [],

  "obj": {

    "obj_id": 39695,

    "display_name": "Test content block",

    "type_id": "ContentBlock",

    "ref_id": 12345,

    "parent_obj_id": 37249,

    "eligibility_status_id": "READY"

  }

}

 

 

PUT Methods

The Content Block endpoint supports the following PUT operations. These operations are intended to update an existing Content Block.

Update a Content Block

This endpoint allows you to submit modifications to an existing Content Block. The request message must include the Content Block's Object Reference ID, and the desired changes. Using this endpoint, you can change the Content Block name, modify the content of a format version, define a new format version, and delete an existing format version. To delete a format version, simply omit it from the request message; any existing format versions that aren't referenced in the request message will be deleted.

 

Click hereClick here to see a sample request message in JSON format.

In the below example, the user is defining a new "HTML" format version, and changing the Content Block name.

 

{

  "cont_id": "12345",

  "cust_id": "123",

  "entity_id": "100",

  "type_id": "PARAGRAPH",

  "view_id": "1002",

  "ContBodies": [

    {

      "cont_id": "12345",

      "type_id": "TEXT",

      "usage_mask": "ALL_EMAIL_STYLE_USAGE_MASK",

      "body": "This is my plain text content."

    },

    {

      "cont_id": "12345",

      "type_id": "HTML",

      "usage_mask": "ALL_EMAIL_STYLE_USAGE_MASK",

      "body": "This my HTML content."

    }

     ],

  "contModelProps": [],

  "contParts": [],

  "Obj": {

    "obj_id": "39695",

    "display_name": "Test content block updated"

  }

}

 

 

Click hereClick here to see a sample response message in JSON format.

{

  "cont_id": 12345,

  "cont_name": "Test content block updated",

  "cust_id": 123,

  "entity_id": 100,

  "type_id": "PARAGRAPH",

  "view_id": 1002,

  "contBodies": [

    {

      "cont_id": 12345,

      "type_id": "TEXT",

      "usage_mask": "ALL_EMAIL_STYLE_USAGE_MASK",

      "body": "This is my plain text content."

    },

    {

      "cont_id": 12345,

      "type_id": "HTML",

      "usage_mask": "ALL_EMAIL_STYLE_USAGE_MASK",

      "body": "This is my HTML content."

    }

  ],

  "contModelProps": [],

  "contParts": [],

  "obj": {

    "obj_id": 39695,

    "display_name": "Test content block updated",

    "type_id": "ContentBlock",

    "ref_id": 43884,

    "parent_obj_id": 37249,

    "eligibility_status_id": "READY"

  }

}

 

 

Run Pickup Changes

After you make changes to a Content Block, you can optionally push those changes out to any launched (but not yet finished deploying) Campaigns that utilize this Content Block. This feature runs the "Pick Up Changes" process on the Campaigns you select. When running "Pick Up Changes," the platform suspends the current version of the Campaign, copies it into a new version, applies the updated content, then launches that new version containing the updated content. All messages not yet deployed will be updated to include the changes (the platform doesn't modify messages that were deployed prior to running Pick Up Changes).

This endpoint allows you to execute the Pick Up Changes process on all email and SMS text Campaigns that use a specified Content Block, and that have unapplied changes in a launched Campaign (you can use the GET method described above to retrieve a list of these Campaigns). You must provide the Object Reference ID for the desired Content Block. The response message will contain the Object Reference IDs for the impacted Campaigns.

 

Click hereClick here to see a sample response message in JSON format.

[

45678,

44556

]

 

 

DELETE Method

The Content Block endpoint supports a DELETE operation that will delete the specified Content Block. You must provide the Object Reference ID for the desired Content Block.

Note: Deleted Content Blocks are moved to the Recycle Bin.

 

Back to API Category - Campaign Management