import Courier from '@trycourier/courier';
const client = new Courier({
apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});
const notificationTemplateVersionListResponse = await client.notifications.listVersions('id');
console.log(notificationTemplateVersionListResponse.paging);{
"versions": [
{
"version": "draft",
"created": 1774037925522,
"creator": "user_abc",
"has_changes": true
},
{
"version": "published:v003",
"created": 1774037924446,
"creator": "user_abc"
},
{
"version": "v002",
"created": 1774037923967,
"creator": "user_def"
},
{
"version": "v001",
"created": 1774037922000,
"creator": "user_def"
}
],
"paging": {
"cursor": null,
"more": false
}
}List versions of a notification template.
import Courier from '@trycourier/courier';
const client = new Courier({
apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});
const notificationTemplateVersionListResponse = await client.notifications.listVersions('id');
console.log(notificationTemplateVersionListResponse.paging);{
"versions": [
{
"version": "draft",
"created": 1774037925522,
"creator": "user_abc",
"has_changes": true
},
{
"version": "published:v003",
"created": 1774037924446,
"creator": "user_abc"
},
{
"version": "v002",
"created": 1774037923967,
"creator": "user_def"
},
{
"version": "v001",
"created": 1774037922000,
"creator": "user_def"
}
],
"paging": {
"cursor": null,
"more": false
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Template ID (nt_ prefix).
Opaque pagination cursor from a previous response. Omit for the first page.
Maximum number of versions to return per page. Default 10, max 10.
x <= 10