Get default push notification template by key

GET /api/communications/push-notifications/default-templates/{key}

Success: 200 OK

Overview

Retrieves a push notification template by its key — the stable text identifier a template ships with, such as CLASS_ALERT — rather than by its numeric id. Reach for this when you know which scenario you are sending for but not which id the tenant has given it: numeric ids differ between tenants and environments, keys do not.

A push notification template holds the wording of the notification once per language, plus up to two tappable actions and the destination the app opens for each. The templates installed by default are CLASS_ALERT, Custom Audience and Site Notification; a tenant may hold others.

The response is identical in shape to Get push notification template by template ID — use that one when you already have the numeric id, for example the id this call returns.

Endpoint

GET {base_url}/api/communications/push-notifications/default-templates/{key}

{base_url} is the environment URL issued to your integration. See Authenticating with Gladstone APIs.

Path parameters

NameTypeRequiredDescription
keystringYesThe template key to look up, matched against the template's stored key (up to 50 characters). CLASS_ALERT, Custom Audience and Site Notification are installed by default. An unrecognised key returns 404 rather than an empty response.

Sample request

cURL
curl -X GET '{base_url}/api/communications/push-notifications/default-templates/{key}' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true'

Response fields

FieldTypeDescription
idinteger (int32)The template's numeric identifier in this tenant. Pass it to Get push notification template by template ID, or use it when scheduling a job against this template. It is tenant-specific — do not hard-code it across environments.
typeIdinteger (int32)The push notification type, which governs what the app does when the notification is opened. The types installed by default are Redirect to Activity/Slot, No Action and Open App.
templateNamestringThe template's display name, up to 50 characters. May be null, and is not the value the key-based lookup matches on.
action1RedirectTointeger (int32)Where the app navigates when the notification's first action is tapped, as a redirect type id. null when the first action has no destination. The redirect types installed by default are Activity slot, Remove class alert and Home Screen. Pairs with content[].action1Label, which supplies the button text.
action2RedirectTointeger (int32)Where the app navigates when the second action is tapped, in the same form as action1RedirectTo. null when there is no second action.
isActivebooleanWhether the template is enabled. Templates are returned by this endpoint whether or not they are active, so check this before sending with one.
contentarray of objectThe wording of the notification, one entry per language it has been translated into. Empty when the template has no content yet.
content[].languagestringThe language this entry is written in, as a language code — en-GB, cy-GB and en-IE are the codes installed by default.
content[].titlestringThe notification title shown on the device, up to 255 characters.
content[].contentstringThe notification body shown on the device, up to 1024 characters.
content[].action1LabelstringThe text on the first action button in this language, up to 50 characters. null when the template has no first action; the destination that action opens is action1RedirectTo.
content[].action2LabelstringThe text on the second action button in this language, up to 50 characters. null when the template has no second action.

Sample response

200 OK
{
  "id": 12345,
  "typeId": 12345,
  "templateName": "string",
  "action1RedirectTo": 1,
  "action2RedirectTo": 1,
  "isActive": true,
  "content": [
    {
      "language": "string",
      "title": "string",
      "content": "string",
      "action1Label": "string",
      "action2Label": "string"
    }
  ]
}

Errors

StatusMeaningWhen
404Not foundNo template holds that key in this tenant (The push notification template with key: {key} does not exist).
500Internal server errorAn unexpected failure reading the template. The response has no body.

This page as markdown · All pages · llms.txt