Search content block
Follow

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

API Endpoint

MoEngage hosts each customer in a different data center; you can find your data center number (value of X) by checking the data center and API endpoint mapping here. Replace the value of 'X' in the endpoint URL based on your DataCenter.

Request Headers

Key Value Description
MOE-APPKEY
The App ID for your MoEngage account.  You can access your MoEngage App key by navigating to Settings > APIs> APP ID on your MoEngage Dashboard.
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

 

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 --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

{
"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

{
  "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?
0 out of 0 found this helpful