Search Content Blocks
curl --request POST \
--url https://api-0{dc}.moengage.com/v1/external/campaigns/content-blocks/search \
--header 'Content-Type: application/json' \
--header 'MOE-APPKEY: <api-key>' \
--data '
{
"filters": {
"content_type": [
"TEXT"
],
"team_ids": [
"0"
],
"tag_ids": [
"6141c7ec9b4cbd0b57c872e5"
],
"status": [
"ACTIVE"
],
"updated_by": [
"geetima@moengage.com"
],
"search_text": "BT_non_personaliation"
}
}
'import requests
url = "https://api-0{dc}.moengage.com/v1/external/campaigns/content-blocks/search"
payload = { "filters": {
"content_type": ["TEXT"],
"team_ids": ["0"],
"tag_ids": ["6141c7ec9b4cbd0b57c872e5"],
"status": ["ACTIVE"],
"updated_by": ["geetima@moengage.com"],
"search_text": "BT_non_personaliation"
} }
headers = {
"MOE-APPKEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'MOE-APPKEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filters: {
content_type: ['TEXT'],
team_ids: ['0'],
tag_ids: ['6141c7ec9b4cbd0b57c872e5'],
status: ['ACTIVE'],
updated_by: ['geetima@moengage.com'],
search_text: 'BT_non_personaliation'
}
})
};
fetch('https://api-0{dc}.moengage.com/v1/external/campaigns/content-blocks/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-0{dc}.moengage.com/v1/external/campaigns/content-blocks/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filters' => [
'content_type' => [
'TEXT'
],
'team_ids' => [
'0'
],
'tag_ids' => [
'6141c7ec9b4cbd0b57c872e5'
],
'status' => [
'ACTIVE'
],
'updated_by' => [
'geetima@moengage.com'
],
'search_text' => 'BT_non_personaliation'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"MOE-APPKEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-0{dc}.moengage.com/v1/external/campaigns/content-blocks/search"
payload := strings.NewReader("{\n \"filters\": {\n \"content_type\": [\n \"TEXT\"\n ],\n \"team_ids\": [\n \"0\"\n ],\n \"tag_ids\": [\n \"6141c7ec9b4cbd0b57c872e5\"\n ],\n \"status\": [\n \"ACTIVE\"\n ],\n \"updated_by\": [\n \"geetima@moengage.com\"\n ],\n \"search_text\": \"BT_non_personaliation\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("MOE-APPKEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-0{dc}.moengage.com/v1/external/campaigns/content-blocks/search")
.header("MOE-APPKEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"filters\": {\n \"content_type\": [\n \"TEXT\"\n ],\n \"team_ids\": [\n \"0\"\n ],\n \"tag_ids\": [\n \"6141c7ec9b4cbd0b57c872e5\"\n ],\n \"status\": [\n \"ACTIVE\"\n ],\n \"updated_by\": [\n \"geetima@moengage.com\"\n ],\n \"search_text\": \"BT_non_personaliation\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-0{dc}.moengage.com/v1/external/campaigns/content-blocks/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["MOE-APPKEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filters\": {\n \"content_type\": [\n \"TEXT\"\n ],\n \"team_ids\": [\n \"0\"\n ],\n \"tag_ids\": [\n \"6141c7ec9b4cbd0b57c872e5\"\n ],\n \"status\": [\n \"ACTIVE\"\n ],\n \"updated_by\": [\n \"geetima@moengage.com\"\n ],\n \"search_text\": \"BT_non_personaliation\"\n }\n}"
response = http.request(request)
puts response.read_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"
],
"team_ids": [
"0"
]
}
]
}{
"title": "Invalid Field Value",
"description": "app_key - Some of the field values are invalid: app_key : None",
"code": "nGpUNpDQ"
}{
"title": "Internal Server Error",
"description": "An unexpected error occurred on the server.",
"code": "SRV_ERR_123"
}Custom Content Blocks
Search Content Blocks
You can use this API to search for the available content blocks in your MoEngage account.
POST
/
content-blocks
/
search
Search Content Blocks
curl --request POST \
--url https://api-0{dc}.moengage.com/v1/external/campaigns/content-blocks/search \
--header 'Content-Type: application/json' \
--header 'MOE-APPKEY: <api-key>' \
--data '
{
"filters": {
"content_type": [
"TEXT"
],
"team_ids": [
"0"
],
"tag_ids": [
"6141c7ec9b4cbd0b57c872e5"
],
"status": [
"ACTIVE"
],
"updated_by": [
"geetima@moengage.com"
],
"search_text": "BT_non_personaliation"
}
}
'import requests
url = "https://api-0{dc}.moengage.com/v1/external/campaigns/content-blocks/search"
payload = { "filters": {
"content_type": ["TEXT"],
"team_ids": ["0"],
"tag_ids": ["6141c7ec9b4cbd0b57c872e5"],
"status": ["ACTIVE"],
"updated_by": ["geetima@moengage.com"],
"search_text": "BT_non_personaliation"
} }
headers = {
"MOE-APPKEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'MOE-APPKEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filters: {
content_type: ['TEXT'],
team_ids: ['0'],
tag_ids: ['6141c7ec9b4cbd0b57c872e5'],
status: ['ACTIVE'],
updated_by: ['geetima@moengage.com'],
search_text: 'BT_non_personaliation'
}
})
};
fetch('https://api-0{dc}.moengage.com/v1/external/campaigns/content-blocks/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-0{dc}.moengage.com/v1/external/campaigns/content-blocks/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filters' => [
'content_type' => [
'TEXT'
],
'team_ids' => [
'0'
],
'tag_ids' => [
'6141c7ec9b4cbd0b57c872e5'
],
'status' => [
'ACTIVE'
],
'updated_by' => [
'geetima@moengage.com'
],
'search_text' => 'BT_non_personaliation'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"MOE-APPKEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-0{dc}.moengage.com/v1/external/campaigns/content-blocks/search"
payload := strings.NewReader("{\n \"filters\": {\n \"content_type\": [\n \"TEXT\"\n ],\n \"team_ids\": [\n \"0\"\n ],\n \"tag_ids\": [\n \"6141c7ec9b4cbd0b57c872e5\"\n ],\n \"status\": [\n \"ACTIVE\"\n ],\n \"updated_by\": [\n \"geetima@moengage.com\"\n ],\n \"search_text\": \"BT_non_personaliation\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("MOE-APPKEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-0{dc}.moengage.com/v1/external/campaigns/content-blocks/search")
.header("MOE-APPKEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"filters\": {\n \"content_type\": [\n \"TEXT\"\n ],\n \"team_ids\": [\n \"0\"\n ],\n \"tag_ids\": [\n \"6141c7ec9b4cbd0b57c872e5\"\n ],\n \"status\": [\n \"ACTIVE\"\n ],\n \"updated_by\": [\n \"geetima@moengage.com\"\n ],\n \"search_text\": \"BT_non_personaliation\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-0{dc}.moengage.com/v1/external/campaigns/content-blocks/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["MOE-APPKEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filters\": {\n \"content_type\": [\n \"TEXT\"\n ],\n \"team_ids\": [\n \"0\"\n ],\n \"tag_ids\": [\n \"6141c7ec9b4cbd0b57c872e5\"\n ],\n \"status\": [\n \"ACTIVE\"\n ],\n \"updated_by\": [\n \"geetima@moengage.com\"\n ],\n \"search_text\": \"BT_non_personaliation\"\n }\n}"
response = http.request(request)
puts response.read_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"
],
"team_ids": [
"0"
]
}
]
}{
"title": "Invalid Field Value",
"description": "app_key - Some of the field values are invalid: app_key : None",
"code": "nGpUNpDQ"
}{
"title": "Internal Server Error",
"description": "An unexpected error occurred on the server.",
"code": "SRV_ERR_123"
}Authorizations
Your MoEngage Workspace ID (App Key). You can find this at Settings -> Account -> APIs -> Workspace ID.
Body
application/json
A set of filters to apply to the search.
A set of filters to apply to the search.
You can send empty filters if you want all the content blocks: { "filters" : {} }
Show child attributes
Show child attributes
Response
Success
Show child attributes
Show child attributes
Was this page helpful?
⌘I