Skip to main content
POST
/
custom-templates
/
push
/
search
Search for Push Templates
curl --request POST \
  --url https://api-0{data_center}.moengage.com/v1.0/custom-templates/push/search \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "page": 1,
  "entries": 10,
  "template_name": "NAME_OF_THE_TEMPLATE(PARTIAL SEARCH)/ID_OF_TEMPLATE",
  "platform": [
    "ANDROID",
    "IOS"
  ],
  "template_source": [
    "API",
    "MOENGAGE"
  ],
  "template_style": [
    "BASIC",
    "STYLIZED"
  ],
  "template_type": [
    "CUSTOM",
    "PRE_BUILT"
  ],
  "created_by": [
    "user1@moengage.com",
    "user2@moengage.com"
  ],
  "updated_by": [
    "user1@moengage.com",
    "user2@moengage.com"
  ],
  "sort_params": [
    {
      "last_modified_date": "DESCENDING"
    }
  ],
  "template_ids": [
    {
      "external_template_id": "ID_OF_TEMPLATE",
      "version": 1
    }
  ]
}
'
{
  "data": [
    {
      "external_template_id": "9b09875c-edda-42e9-8f9f-a7d0a9a2aa26",
      "version": 2,
      "ANDROID": {
        "basic_details": {
          "background_color_code": "#ffffff",
          "notification_control_color": "Dark",
          "apply_background_color": false,
          "title": "Winter Sale 50% Off",
          "message": "Sample Message",
          "summary": "Sample Summary",
          "image_url": "",
          "default_click_action": "RICH_LANDING",
          "default_click_action_value": "https://www.google.com"
        },
        "buttons": [
          {
            "btn_name": "View Offers",
            "click_action_type": "RICH_LANDING",
            "click_action_value": "https://www.google.com"
          },
          {
            "btn_name": "Show More Like This",
            "click_action_type": "RICH_LANDING",
            "click_action_value": "https://www.google.com"
          }
        ],
        "advanced": {
          "icon_type_in_notification": "appicon",
          "make_notification_sticky": true,
          "dismiss_button_text": "Dismiss",
          "auto_dismiss_notification": true,
          "dismissal_time_value": 24,
          "dismissal_time_multiplier": "hours"
        },
        "template_backup": {
          "title": "Stylized Android Template",
          "message": "Sample Stylized Android Template",
          "default_click_action": "RICH_LANDING",
          "default_click_action_value": "https://www.google.com"
        }
      },
      "IOS": {
        "basic_details": {}
      },
      "meta_info": {
        "platform": [
          "ANDROID"
        ],
        "template_style": "STYLIZED",
        "template_id": "Stylizedandroid1",
        "template_name": "Stylized Android Template 2",
        "template_version": "1",
        "updated_by": "Jane Doe",
        "channel": "PUSH",
        "template_source": "API",
        "template_type": "CUSTOM"
      },
      "created_by": "John Doe",
      "created_at": "2023-02-27T12:33:05.575000",
      "updated_by": "Jane Doe",
      "updated_at": "2023-02-27T12:33:05.575000"
    }
  ]
}

Authorizations

Authorization
string
header
required

HTTP Basic Authentication using your Workspace ID as the username and API Key as the password.

Body

application/json

A JSON object containing filters for the search. You can send empty filters to fetch all the push templates.

page
integer
default:1
required

The page number of the results you wish to fetch.

entries
integer
default:10
required

The number of templates to return per page, with a maximum value of 15.

Required range: x <= 15
template_name
string

This field indicates the name of the template. When this value is specified, the template that matches the name specified in this field will be returned.

platform
enum<string>[]

This field indicates the list of platforms. Allowed values: ANDROID, IOS. When specified, the templates whose platform matches that specified in this list will be returned.

Available options:
ANDROID,
IOS
template_source
enum<string>[]

This field indicates the template source that created the template. For example: ["API", "MOENGAGE"]. When specified, the templates whose source matches that specified in this list will be returned.

Available options:
API,
MOENGAGE
template_style
enum<string>[]

This field indicates the template style. Allowed values: BASIC, STYLIZED. When specified, the templates whose template style matches that specified in this list will be returned.

Available options:
BASIC,
STYLIZED
template_type
enum<string>[]

This field indicates whether the template is a custom one or a pre-built one. Allowed values: CUSTOM, PRE_BUILT. When specified, the templates whose template type matches that specified in this list will be returned.

Available options:
CUSTOM,
PRE_BUILT
created_by
string<email>[]

This field indicates the user who created the template. When specified, the templates for which the created_by user information matches that specified in this list will be returned. Example: ["user1@moengage.com", "user2@moengage.com"]

updated_by
string<email>[]

This field indicates the user who updated the template. When specified, the templates for which the updated_by user information matches that specified in this list will be returned. Example: ["user1@moengage.com", "user2@moengage.com"]

sort_params
object[]

This field indicates the sorting parameters for the search result and the sort order. Example: "sort_params":[{"template_name": "ASCENDING","last_modified_date": "ASCENDING","last_modified_by": "ASCENDING"}]

template_ids
object[]

This field indicates the list of the template ids that must be fetched. When this value is specified, the template that matches the id specified in this field will be returned. You can send only template_ids if you want specific older versions of the push template. In other cases, you will receive the latest version of the template. Example: "template_ids":[{"external_template_id": "e1c95cb8-4f15-4f22-ae73-e9f47c9925c8", "version": 1}]

Response

This response is returned when the request is processed successfully.

data
object[]

This field contains the list of push templates that satisfy the search criteria.