We’ve discovered that https://youraccountname.api-us1.com/api/3/contacts/{id}/contactLists
will retrieve all memberships for a contact.
Is there a query which can get the membership of 1 specific list for a contact?
I tried adding a filter to the query, e.g. https://youraccountname.api-us1.com/api/3/contacts/{id}/contactLists?filters[list]=1
though this didn’t seem to work.
Thank you
The /contacts
api endpoint will provide exactly what you need. Here are some params that you can pass to /contacts
(there are many more parameters available):
-
ids
(the Contact ID)
-
listid
(the List ID)
-
status
(their subscription status)
Example 1:
Make a GET
call to: https://{{yourAccountName}}.api-us1.com/api/3/contacts?ids=14&listid=2&status=2
…returns all contacts with the id of 14
subscribed to List with id 2
and a subscription status of 2
Example 2:
A GET
call to: https://{{yourAccountName}}.api-us1.com/api/3/contacts?listid=2
…returns all contacts in list id 2
Here’s what those status codes mean