Get push notification template by template ID

GET /api/communications/push-notifications/default-template/{id}

Success: 200 OK

Overview

Retrieves a push notification template by its numeric identifier, returning the wording of the notification in every language it has been translated into, along with its two optional tap actions and their destinations.

Use this when you already hold the id — for example the id returned by Get default push notification template by key, which looks the same template up by a key that is stable across tenants. Template ids are not: the id for a given template differs from one tenant and environment to the next, so resolve it by key rather than hard-coding it.

The two endpoints return the same payload; this one exists for callers that already have an id.

Endpoint

GET {base_url}/api/communications/push-notifications/default-template/{id}

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

Path parameters

NameTypeRequiredDescription
idinteger (int32)YesThe template to return. Any integer is accepted by the route: 0 and negative values are not rejected as invalid, they simply match no template and return 404. A non-integer segment fails at routing with 400.

Sample request

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

Response fields

FieldTypeDescription
idinteger (int32)The template's numeric identifier — the value you asked for, echoed back.
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
400Bad requestThe {id} segment is not an integer (The value 'abc' is not valid.).
404Not foundNo template with that id in this tenant (The push notification template with ID: {id} does not exist). Zero and negative ids land here too, not on 400.
500Internal server errorAn unexpected failure reading the template. The response has no body.

This page as markdown · All pages · llms.txt