Dynamic Block

Overview

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

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

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

GET Method

The Dynamic Block endpoint supports the following GET operation. This operation is intended to retrieve information about an existing Dynamic Block.

Retrieve a Dynamic Block

This endpoint allows you to retrieve information about a specified Dynamic Block by providing its Object Reference ID.

 

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

{

  "cont_id": 48407,

  "cont_name": "Test dynamic block",

  "cust_id": 123,

  "entity_id": 100,

  "type_id": "LOGIC_BLOCK",

  "view_id": 1002,

  "contBodies": [],

  "contModelProps": [

    {

      "cont_id": 48407,

      "prop_id": 1210,

      "variable_id": 1

    }

  ],

  "contParts": [

    {

      "parent_cont_id": 48407,

      "seq": 1,

      "child_cont_id": 50378,

      "default_flag": 0,

      "else_flag": 1,

      "case_val": "IL",

      "childContent": {

        "cont_id": 50378,

        "cont_name": "Illinois block",

        "cust_id": 394,

        "entity_id": 100,

        "type_id": "PARAGRAPH",

        "view_id": 1002,

        "contBodies": [],

        "contModelProps": [],

        "contParts": [],

        "obj": {

          "obj_id": 43953,

          "display_name": "Illinois block",

          "type_id": "ContentBlock",

          "ref_id": 50378,

          "parent_obj_id": 37249,

          "eligibility_status_id": "READY"

        }

      }

    },

    {

      "parent_cont_id": 48407,

      "seq": 2,

      "child_cont_id": 50379,

      "default_flag": 0,

      "else_flag": 1,

      "case_val": "WI",

      "childContent": {

        "cont_id": 50379,

        "cont_name": "Wisc block",

        "cust_id": 394,

        "entity_id": 100,

        "type_id": "PARAGRAPH",

        "view_id": 1002,

        "contBodies": [],

        "contModelProps": [],

        "contParts": [],

        "obj": {

          "obj_id": 43954,

          "display_name": "Wisc block",

          "type_id": "ContentBlock",

          "ref_id": 50379,

          "parent_obj_id": 37249,

          "eligibility_status_id": "READY"

        }

      }

    },

    {

      "parent_cont_id": 48407,

      "seq": 3,

      "child_cont_id": 50380,

      "default_flag": 0,

      "else_flag": 0,

      "case_val": "IA",

      "childContent": {

        "cont_id": 50380,

        "cont_name": "Iowa block",

        "cust_id": 394,

        "entity_id": 100,

        "type_id": "PARAGRAPH",

        "view_id": 1002,

        "contBodies": [],

        "contModelProps": [],

        "contParts": [],

        "obj": {

          "obj_id": 43955,

          "display_name": "Iowa block",

          "type_id": "ContentBlock",

          "ref_id": 50380,

          "parent_obj_id": 37249,

          "eligibility_status_id": "READY"

        }

      }

    }

  ],

  "obj": {

    "obj_id": 42493,

    "display_name": "Test dynamic block",

    "type_id": "DynamicBlock",

    "ref_id": 48407,

    "parent_obj_id": 37249,

    "eligibility_status_id": "READY"

  }

}

 

 

POST Method

The Dynamic Block endpoint supports the following POST operation. This operation is intended to create a new Dynamic Block.

Create a Dynamic Block

This endpoint allows you to create a new Dynamic Block by providing the following basic information:

The rest of the information in the request message depends on which query type you're using to define the Dynamic Block logic -- by Field / Value, or by Filter.

If you're creating a Dynamic Block using a Field / Value query type, the request message must include the following information:

Click hereClick here to see a sample request message in JSON format, that uses the Field / Value query type.

This sample POST request message creates a new Dynamic Block with one Rule / Block Pair based on the "by value in a field" query type, and an IF > IF logical structure. The Rule / Block Pair is looking for a value of "IL" within a State field. The payload also includes default content.

The "contParts" object defines all of the different Rule / Block Pairs within the Dynamic Block. For each Rule / Block Pair, you must define:

{

    "cust_id": 394,

    "entity_id": 100,

    "type_id": "LOGIC_BLOCK",

    "view_id": 1002,

    "contBodies": [],

    "contModelProps": [

         {

         "prop_id": 1210

         }

      ],

    "contParts": [

        {

            "seq": 1,

            "child_cont_id": 50378,

            "default_flag": 0,

            "else_flag": 0,

            "case_val": "IL",

            "childContent": {

                "cont_id": 50378,

                "cont_name": "Illinois block",

                "cust_id": 394,

                "entity_id": 100,

                "type_id": "PARAGRAPH",

                "view_id": 1002,

                "contBodies": [

                {

                      "cont_id": 50378,

                      "type_id": "TEXT",

                      "usage_mask": "EMAIL",

                      "body": "IL content block - Plain text"

                },

                {

                     "cont_id": 50378,

                     "type_id": "HTML",

                     "usage_mask": "ALL_EMAIL_STYLE_USAGE_MASK",

                     "body": "IL content block - HTML"

                }

           ],

                "contModelProps": [],

                "contParts": [],

                "obj": {

                   "obj_id": 43953,

                   "display_name": "Illinois block",

                   "type_id": "ContentBlock",

                   "ref_id": 50378,

                   "parent_obj_id": 37249,

                   "eligibility_status_id": "READY"

                }

           }

     }

  ],

    "obj": {

        "display_name": "API Dynamic Block",

        "parent_obj_id": 37249

    }

}

 

 

If you're creating a Dynamic Block using a Filter query type, the request message must include the following information:

Click hereClick here to see a sample request message in JSON format, that uses the Filter query type.

This sample POST request message creates a new Dynamic Block with one Rule / Block Pair based on inclusion in a Filter, and an IF > ELSE IF logical structure. The payload also includes default content.

The "contParts" object defines all of the different Rule / Block Pairs within the Dynamic Block. For each Rule / Block Pair, you must define:

{

    "cust_id": 394,

    "entity_id": 100,

    "type_id": "LOGIC_BLOCK",

    "view_id": 1002,

    "contBodies": [],

    "contModelProps": [],

    "contParts": [

        {

            "seq": 1,

            "child_cont_id": 52686,

            "default_flag": 0,

            "else_flag": 1,

            "filter_id": 30400,

            "childContent": {

                "cont_id": 52686,

                "cont_name": "Gold",

                "cust_id": 394,

                "entity_id": 100,

                "type_id": "PARAGRAPH",

                "view_id": 1002,

                "contBodies": [

                {

                      "cont_id": 52686,

                      "type_id": "TEXT",

                      "usage_mask": "EMAIL",

                      "body": "Gold plain text content goes here. "

                },

                {

                      "cont_id": 52686,

                      "type_id": "HTML",

                      "usage_mask": "ALL_EMAIL_STYLE_USAGE_MASK",

                      "body": "Gold HTML content goes here. "

                }

           ],

                "contModelProps": [],

                "contParts": [],

               "obj": {

                      "obj_id": 45935,

                      "display_name": "Gold",

                      "type_id": "ContentBlock",

                      "ref_id": 52686,

                      "parent_obj_id": 37249,

                      "eligibility_status_id": "READY"

                }

            }

        },

        {

            "seq": 2,

            "child_cont_id": 57940,

            "default_flag": 1,

            "else_flag": 1,

            "childContent": {

                "cont_id": 57940,

                "cont_name": "Default Content Block",

                "cust_id": 394,

                "entity_id": 100,

                "type_id": "PARAGRAPH",

                "view_id": 1002,

                "contBodies": [

                  {

                     "cont_id": 57940,

                     "type_id": "TEXT",

                     "usage_mask": "EMAIL",

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

                  },

                  {

                      "cont_id": 57940,

                      "type_id": "HTML",

                      "usage_mask": "EMAIL, WEB, WEB_SOCIAL",

                      "body": "HTML default content goes here."

                  }

                ],

                "contModelProps": [],

                "contParts": [],

                "obj": {

                      "obj_id": 50595,

                      "display_name": "Default Content Block",

                     "type_id": "ContentBlock",

                      "ref_id": 57940,

                      "parent_obj_id": 37249,

                      "eligibility_status_id": "READY"

                }

            } 

        }      

    ],

    "obj": {

        "display_name": "Gold Level API Dynamic Block",

        "parent_obj_id": 37249

    }

}

 

PUT Method

The Dynamic Block endpoint supports the following PUT operation. This operation is intended to update an existing Dynamic Block.

Update a Dynamic Block

This endpoint allows you to submit modifications to an existing Dynamic Block. The request message must include the Dynamic Block's Object Reference ID, and the desired changes. Using this endpoint, you can change the Dynamic Block name, modify a Rule / Block Pair, add a new Rule / Block Pair, or remove a Rule / Block Pair. To remove a Rule / Block Pair, simply omit it from the request message; any existing Rule / Block Pairs that aren't referenced in the request message will be removed.

 

DELETE Method

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

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

 

Back to API Category - Campaign Management