# Push Templates API

## Get Template

<mark style="color:blue;">`GET`</mark> `https://api.codemash.io/:version/notifications/push/templates/:id`

Gets a push notification template.

#### Path Parameters

| Name    | Type   | Description                                             |
| ------- | ------ | ------------------------------------------------------- |
| version | string | The version of the API endpoint. Current latest **v1**. |
| id      | string | The ID of a template to get.                            |

#### Headers

| Name           | Type   | Description                                            |
| -------------- | ------ | ------------------------------------------------------ |
| Authorization  | string | Your project's secret key.                             |
| x-cm-projectid | string | Your project's ID. Can be passed as a query parameter. |

{% tabs %}
{% tab title="200 Returns an ID of created notification group." %}

```javascript
{
    Result: ""
}
```

{% endtab %}

{% tab title="401 Returns if the user does not have a valid permission to call this method." %}

```
```

{% endtab %}

{% tab title="500 " %}

```
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title=".NET" %}

```csharp
var client = new CodeMashClient(apiKey, projectId);
var pushService = new CodeMashPushService(client);

var response = await pushService.GetTemplateAsync(
    new GetNotificationTemplateRequest
    {
        Id = Guid.Parse("{TEMPLATEID_ID}")
    }
);
```

{% endtab %}

{% tab title="Node" %}

```
```

{% endtab %}
{% endtabs %}

## Get Templates

<mark style="color:blue;">`GET`</mark> `https://api.codemash.io/:version/notifications/push/templates`

Gets many push notification templates.

#### Path Parameters

| Name    | Type   | Description                                             |
| ------- | ------ | ------------------------------------------------------- |
| version | string | The version of the API endpoint. Current latest **v1**. |

#### Headers

| Name           | Type   | Description                                            |
| -------------- | ------ | ------------------------------------------------------ |
| Authorization  | string | Your project's secret key.                             |
| x-cm-projectid | string | Your project's ID. Can be passed as a query parameter. |

{% tabs %}
{% tab title="200 Returns an ID of created notification group." %}

```javascript
{
    Result: ""
}
```

{% endtab %}

{% tab title="401 Returns if the user does not have a valid permission to call this method." %}

```
```

{% endtab %}

{% tab title="500 " %}

```
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title=".NET" %}

```csharp
var client = new CodeMashClient(apiKey, projectId);
var pushService = new CodeMashPushService(client);

var response = await pushService.GetTemplatesAsync(
    new GetNotificationTemplatesRequest()
);
```

{% endtab %}
{% endtabs %}
