import Courier from '@trycourier/courier';
const client = new Courier({
apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});
const subscriptions = await client.lists.subscriptions.list('list_id');
console.log(subscriptions.items);{
"paging": {
"more": true,
"cursor": "<string>"
},
"items": [
{
"recipientId": "<string>",
"created": "<string>",
"preferences": {
"categories": {},
"notifications": {}
}
}
]
}Get the list’s subscriptions.
import Courier from '@trycourier/courier';
const client = new Courier({
apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});
const subscriptions = await client.lists.subscriptions.list('list_id');
console.log(subscriptions.items);{
"paging": {
"more": true,
"cursor": "<string>"
},
"items": [
{
"recipientId": "<string>",
"created": "<string>",
"preferences": {
"categories": {},
"notifications": {}
}
}
]
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
A unique identifier representing the list you wish to retrieve.
A unique identifier that allows for fetching the next set of list subscriptions