API Reference
Retrieve Contact Topics
GET /contacts/:id/topics — retrieve a list of topic subscriptions for a contact.
GET
/contacts/:id/topicsRetrieve a list of topic subscriptions for a contact. The contact is identified in the path by either its ID or its email address.
Either id or email must be provided.
Path parameters
idstringoptionalThe Contact ID.
emailstringoptionalThe Contact Email.
Query parameters
limitnumberoptionalNumber of topics to retrieve. Maximum value: 100. Minimum value: 1.
afterstringoptionalThe ID *after* which we'll retrieve more topics (for pagination). This ID will *not* be included in the returned list. Cannot be used with the before parameter.
beforestringoptionalThe ID *before* which we'll retrieve more topics (for pagination). This ID will *not* be included in the returned list. Cannot be used with the after parameter.
import { MailBlastr } from 'mailblastr';
const mb = new MailBlastr('mb_xxxxxxxxx');
const { data, error } = await mb.contacts.getTopics('e169aa45-1ecf-4183-9955-b1499d5701d3');
console.log({ data, error });Response
{
"object": "list",
"has_more": false,
"data": [
{
"id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e",
"name": "Product Updates",
"description": "New features, and latest announcements.",
"subscription": "opt_in"
}
]
}