Template

Learn how to create Templates using API V5

The Templates API enables the creation, updating, and retrieval of message templates through APIs. It supports App Push Notifications (APN), including platform-specific content, personalization, rich media, landing page actions, and custom key-value pairs.

Prerequisites

Before using the APN Templates API, ensure that the following requirements are met:

  • A valid Netcore API key is available.
  • The account has access to the required APN functionality.
  • Requests use Content-Type: application/json.
  • The appropriate regional base URL is configured.

APN Template Operations

OperationEndpointMethodDescription
Create Templates/client/template/createPOSTCreates APN templates with the specified content and configuration.
Update Templates/client/template/updatePOSTUpdates existing templates using their template IDs.
Search Templates/client/template/searchPOSTRetrieves templates based on filtering criteria, sorting, pagination, and selected fields.

Authentication

All requests require a valid API key passed through the api-key HTTP header.

Include the following headers in requests:

HeaderRequiredDescription
api-keyYesAPI key used to authenticate the request.
Content-TypeYes for JSON requestsSet to application/json.

Keep API keys secure and avoid exposing them in publicly accessible code or documentation examples.

Example:

POST {{BASE_URL}}/client/template/create
api-key: YOUR_API_KEY
Content-Type: application/json

Replace YOUR_API_KEY and {{BASE_URL}} with the appropriate values for the account.

Create an APN Template

The following example creates a regular APN template with configurations for Android and iOS.

curl --location --request POST '{{BASE_URL}}/client/template/create' \
--header 'api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
  "data": {
    "templates": [
      {
        "channel_name": "apn",
        "template_name": "Welcome Notification",
        "custom": {
          "template_type": "regular",
          "os": "all"
        },
        "content": {
          "title": "Welcome",
          "description": "Welcome to our app.",
          "landing_page_type": "app_homepage",
          "apn_interactions": [
            {
              "os_type": "ios",
              "subtitle": "Explore the app"
            },
            {
              "os_type": "android",
              "subtitle": "Explore the app"
            }
          ]
        }
      }
    ]
  }
}'

The example illustrates the request structure. Additional fields can be included according to the selected template type and supported platform configuration.

Base URLs by Region

Use the regional API host configured for the account.

RegionBase URL
Indiahttps://netcoreapi-main-prod-ind.netcorein.com/v5/
Europehttps://netcoreapi-main-prod-eu.netcorein.com/v5/
United Stateshttps://netcoreapi-main-prod-us.netcorein.com/v5/
Indonesiahttps://netcoreapi-gprd-id.netcorein.com

Troubleshooting and FAQs

Which channels are supported?

The supplied Templates API specification defines apn as the supported channel_name value. Support for additional channels is not established by this specification.

Can a template contain both Android and iOS configurations?

Yes. The request structure supports multiple entries in content.apn_interactions, with each entry specifying an os_type of android or ios. The custom.os field supports all, android, and ios.

Can multiple templates be created or updated in one request?

Both Create and Update accept a templates array, allowing multiple template objects to be included in a request. Any applicable batch limits should be confirmed before publishing them.

How are templates searched?

The Search Templates endpoint supports filtering criteria, logical operators, sorting, pagination, and field selection. The request must include channel_name.