# Get push notification template by template ID

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

- **Success:** `200 OK`
- **Products:** Operator (`FOH`)
- **Features:** Front of House Generic Access (`FOHGENERIC`)

HTML version: [Get push notification template by template ID](https://support.gladstonesoftware.cloud/reference/communications/get-push-notification-template-by-template-id)

## 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](get-default-push-notification-template-by-key.md), 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](../../guides/authenticating-with-gladstone-apis.md).

## Path parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | integer (int32) | Yes | The 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

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

## Response fields

| Field | Type | Description |
|-------|------|-------------|
| `id` | integer (int32) | The template's numeric identifier — the value you asked for, echoed back. |
| `typeId` | integer (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`. |
| `templateName` | string | The template's display name, up to 50 characters. May be `null`, and is not the value the key-based lookup matches on. |
| `action1RedirectTo` | integer (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. |
| `action2RedirectTo` | integer (int32) | Where the app navigates when the second action is tapped, in the same form as `action1RedirectTo`. `null` when there is no second action. |
| `isActive` | boolean | Whether the template is enabled. Templates are returned by this endpoint whether or not they are active, so check this before sending with one. |
| `content` | array of object | The wording of the notification, one entry per language it has been translated into. Empty when the template has no content yet. |
| `content[].language` | string | The language this entry is written in, as a language code — `en-GB`, `cy-GB` and `en-IE` are the codes installed by default. |
| `content[].title` | string | The notification title shown on the device, up to 255 characters. |
| `content[].content` | string | The notification body shown on the device, up to 1024 characters. |
| `content[].action1Label` | string | The 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[].action2Label` | string | The text on the second action button in this language, up to 50 characters. `null` when the template has no second action. |

## Sample response

```json title="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

| Status | Meaning | When |
|--------|---------|------|
| `400` | Bad request | The `{id}` segment is not an integer (`The value 'abc' is not valid.`). |
| `404` | Not found | No 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`. |
| `500` | Internal server error | An unexpected failure reading the template. The response has no body. |
