JavaScript
import Courier from '@trycourier/courier';
const client = new Courier({
apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});
const notifications = await client.notifications.list();
console.log(notifications.paging);import os
from courier import Courier
client = Courier(
api_key=os.environ.get("COURIER_API_KEY"), # This is the default and can be omitted
)
notifications = client.notifications.list()
print(notifications.paging)package main
import (
"context"
"fmt"
"github.com/trycourier/courier-go"
"github.com/trycourier/courier-go/option"
)
func main() {
client := courier.NewClient(
option.WithAPIKey("My API Key"),
)
notifications, err := client.Notifications.List(context.TODO(), courier.NotificationListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", notifications.Paging)
}package com.courier.example;
import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.notifications.NotificationListParams;
import com.courier.models.notifications.NotificationListResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
NotificationListResponse notifications = client.notifications().list();
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
notifications = courier.notifications.list
puts(notifications)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Courier\Client;
use Courier\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('COURIER_API_KEY') ?: 'My API Key');
try {
$notifications = $client->notifications->list(
cursor: 'cursor', eventID: 'event_id', notes: true
);
var_dump($notifications);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using TryCourier;
using TryCourier.Models.Notifications;
CourierClient client = new();
NotificationListParams parameters = new();
var notifications = await client.Notifications.List(parameters);
Console.WriteLine(notifications);courier notifications list \
--api-key 'My API Key'curl --request GET \
--url https://api.courier.com/notifications \
--header 'Authorization: Bearer <token>'{
"paging": {
"cursor": "MTpFWUNFRkRRN0c1WERTRTU2",
"more": true
},
"results": [
{
"created_at": 1,
"updated_at": 1,
"id": "nt_01kx4h2jdafq8bk9aftxak4b40",
"routing": {
"method": "all",
"channels": [
"string"
]
},
"tags": {
"data": [
{
"id": "abc-123",
"name": "Example Name"
}
]
},
"title": "Example Name",
"topic_id": "pt_01kx4h2jdafq8bk99mj9q2gsa2",
"note": "string",
"event_ids": [
"string"
]
}
]
}Notification Templates
List Notification Templates
List notification templates in your workspace.
GET
/
notifications
JavaScript
import Courier from '@trycourier/courier';
const client = new Courier({
apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});
const notifications = await client.notifications.list();
console.log(notifications.paging);import os
from courier import Courier
client = Courier(
api_key=os.environ.get("COURIER_API_KEY"), # This is the default and can be omitted
)
notifications = client.notifications.list()
print(notifications.paging)package main
import (
"context"
"fmt"
"github.com/trycourier/courier-go"
"github.com/trycourier/courier-go/option"
)
func main() {
client := courier.NewClient(
option.WithAPIKey("My API Key"),
)
notifications, err := client.Notifications.List(context.TODO(), courier.NotificationListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", notifications.Paging)
}package com.courier.example;
import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.notifications.NotificationListParams;
import com.courier.models.notifications.NotificationListResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
NotificationListResponse notifications = client.notifications().list();
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
notifications = courier.notifications.list
puts(notifications)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Courier\Client;
use Courier\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('COURIER_API_KEY') ?: 'My API Key');
try {
$notifications = $client->notifications->list(
cursor: 'cursor', eventID: 'event_id', notes: true
);
var_dump($notifications);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using TryCourier;
using TryCourier.Models.Notifications;
CourierClient client = new();
NotificationListParams parameters = new();
var notifications = await client.Notifications.List(parameters);
Console.WriteLine(notifications);courier notifications list \
--api-key 'My API Key'curl --request GET \
--url https://api.courier.com/notifications \
--header 'Authorization: Bearer <token>'{
"paging": {
"cursor": "MTpFWUNFRkRRN0c1WERTRTU2",
"more": true
},
"results": [
{
"created_at": 1,
"updated_at": 1,
"id": "nt_01kx4h2jdafq8bk9aftxak4b40",
"routing": {
"method": "all",
"channels": [
"string"
]
},
"tags": {
"data": [
{
"id": "abc-123",
"name": "Example Name"
}
]
},
"title": "Example Name",
"topic_id": "pt_01kx4h2jdafq8bk99mj9q2gsa2",
"note": "string",
"event_ids": [
"string"
]
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Opaque pagination cursor from a previous response. Omit for the first page.
Include template notes in the response. Only applies to legacy templates.
Filter to templates linked to this event map ID.
⌘I