API Reference

Retrieve Contact Topics

GET /contacts/:id/topics — retrieve a list of topic subscriptions for a contact.

GET/contacts/:id/topics

Retrieve 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
idstringoptional

The Contact ID.

emailstringoptional

The Contact Email.

Query parameters
limitnumberoptional

Number of topics to retrieve. Maximum value: 100. Minimum value: 1.

afterstringoptional

The 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.

beforestringoptional

The 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"
    }
  ]
}