Search content block

You can use this API to search for the available content blocks in your MoEngage account.

API Endpoint

The 'X' in the API Endpoint URL refers to the MoEngage Data Center (DC). MoEngage hosts each customer in a different DC. You can find your DC number (value of X) and replace the value of 'X' in the URL by referring to the DC and API endpoint mapping here.

Request Headers

Key Value Description
MOE-APPKEY
The App ID for your MoEngage account. 

You can find your MoEngage APP key in the following navigation on the Dashboard:

Revamped UI: Settings -> Account -> APIs -> App ID

Old UI: Settings -> API -> General Settings -> DATA API

Content-Type application/json --

Request Body

Filters Value Value Description

content type 

Optional

HTML/Plain Text 

Type of the content block - HTML/Text 

team_ids

Optional

List of team ids

Name of the teams for which the content block is enabled. This is only applicable to the accounts where Teams is enabled. For more information, refer to Teams.

tag_ids

Optional

List of tags ids 

Ids of the tags

status

Optional

Active/Archived 

Status of the content block 

updated_by

Optional

Email id  

Email id of the user who updated the content block 

search_text

Optional

String

You can use this to search content block by content block name

info

Note

You can send empty filters if you want all the content blocks. 

{ 
"filters" : {}
}

Response

Status Code Request State Description Response Body

HTTP 202

Success

Content block data

{ "data": [{}]}

HTTP 

400

Bad Request

 

{

   "title": "Invalid Field Value",

   "description": "app_key - Some of the field values are invalid: app_key : None",

   "code": "nGpUNpDQ"

}

HTTP 5xx

Failure

Server issue

{ "title": "Internal Server Error", ... }

Request Parameters

Sample cURL request

cURL
curl --location --request POST 'https://api-0X.moengage.com/v1/external/campaigns/content-blocks/search' \
--header 'MOE-APPKEY: {{APP-KEY}}' \ --header 'Content-Type: application/json' \ --data-raw '{ "filters": { } }’

 Sample Request Body

JSON
{
    "filters": {
    "content_type": ["TEXT"],
    "team_ids": ["0"],
    "tag_ids": ["6141c7ec9b4cbd0b57c872e5"],
    "status": ["ACTIVE"],
    "updated_by": ["geetima@moengage.com"],
    "search_text": "BT_non_personaliation”
    }
}

Sample Response Body

JSON
{
   "data": [
       {
           "id": "61dd90a4cdfd67a8d48ef681",
           "name": "BT_non_personaliation",
           "label": "BT_non_personaliation",
           "description": "BT_non_personaliation",
           "content_type": "TEXT",
           "status": "ACTIVE",
           "created_by": "geetima@moengage.com",
           "created_at": "2022-01-11T14:13:56.063000",
           "updated_by": "geetima@moengage.com",
           "updated_at": "2022-01-11T14:15:31.254000",
           "tag_ids": [
               "6141c7ec9b4cbd0b57c872e5",
               "61409d091202397cc82f8356",
               "6059bd3bfdc964536aa9e2ac"
           ],
           "team_ids": [
               "0"
           ]
       }
   ]
}

Attribute Mapping

Key Data type Description
id string Content block id that was passed in the request
name string Name of the content block  
description string Description of the content block 
content_type string Type of the content block - HTML/Text 
content string Content of the content block 
created_by string Email id of the user who created the content block 
created_at string Date Time of the content block creation 
updated_by string Email id of the user who updates the content block 
updated_at string Date Time of the content block update 
tag_ids array of strings Tags associated with the content block
team_ids array of strings Name of the teams for which the content block is enabled. This is only applicable to the accounts where Teams is enabled. For more information, refer to Teams.

 

Was this article helpful?
1 out of 1 found this helpful

How can we improve this article?