The Is Contact in List Batch command allows you to validate if a subscriptions exist for the List based on a batch of JSON requests.
POST /lists/isSubscriberOnListBatch
https://[siteurl]/rest/lists/isSubscriberOnListBatch
Request Body Parameters
The Is Contact in List Batch command requires the List ID and one or more of the following in the Posted JSON. Filters include Email, First Name, Last Name, and Customer Key parameters. Customer Key is only supported in Realms in which the field is enabled.
- List Identifier: "listId": "[listId]"
- Email: "email": "[email]"
- First Name: "firstName": "[firstName]"
- Last Name: "lastName": "[lastName]"
- Customer Key: "customerKey": "[customerKey]
Request Body Example
Using Is Contact in List:
curl --request GET \
--url 'https://mail.mydomain.com/rest/lists/isSubscriberOnListBatch' \
--header 'authorization: Basic bXlBY2NvdW50Onh5enB3ZDEyMw==' \
--header 'accept: application/vnd.whatcounts-v1+json' \
--header 'content-type: application/json' \
--data '[{
"listId": "5",
"subscribers": [{
"email": "jon@mydomain.com",
"firstName": "Jon",
"lastName": "Doe"}
{
"email": "jane@mydomain.com",
"firstName": "Jane",
"lastName": "Doe"}]
}],
--include
Response Body
The response returns the Contact data JSON including a value of true if a subscription exists or false otherwise. Based on the example above, the response returns the following.
HTTP/1.1 200 OK
Server: serverName
Content-Type: application/json
Content-Length: 926
Link: <https://mail.mydomain.com/rest/lists/isSubscriberOnListBatch>;
Date: Fri, 17 Jun 2018 12:54:44 GMT
[
{
"listId": 5,
"subscribers": [
{
"email": "jon@mydomain.com",
"firstName": "Jon",
"lastName": "Doe",
"isOnList": true
},
{
"email": "jane@mydomain.com",
"firstName": "Jane",
"lastName": "Doe",
"isOnList": false
}
]
}
]
Error Response
Error Response Codes include both Client Errors (4xx) and Server Errors (5xx). Descriptions of each can be found in Response Codes.
For example, if the Authorization is incorrect, the error would appear as:
{
"error": "Unauthorized"
"status": "Unauthorized"
"statusCode": 401
}