Follow

Is Subscriber in List

The Is Subscriber in List command allows you to validate if a subscription exists for the List based on a compound filter, or query string.

GET /lists/isSubscriberOnList/[listId]?querystring

https://[siteurl]/rest/lists/isSubscriberOnList/[listId]?querystring

The Is Subscriber in List command requires the List ID defined within the URI in order to search subscriptions. The following queries are supported and can be combined in any order.  Customer Key is only supported in Accounts in which the field is enabled:

firstName=[subscriber.firstname]
lastName=[subscriber.lastname]
email=[subscriber.emal]
customerKey=[subscriber.customerkey]

Request Body Parameters

The Is Subscriber in List command requires the URI call with the List ID and subscribers parameter. Filters include Email, First Name, Last Name, and Customer Key parameters. No additional fields are required in the JSON.    

The query strings 'firstName', 'lastName', and 'customerKey' are case sensitive and must be defined as in the example above.  If the query string is incorrect or the List does not exist, it is ignored and the command returns false.

If any of the query strings contain spaces, URL encode the space with '%20', for instance:

  • My First Name

    becomes

  • My%20First%20Name

Request Body Example

Using Is Subscriber in List:

curl --request GET \ 
--url 'https://mail.mydomain.com/rest/lists/isSubscriberOnList/5?lastName=Doe&firstName=Jon' \
--header 'authorization: Basic bXlBY2NvdW50Onh5enB3ZDEyMw==' \
--header 'accept: application/vnd.whatcounts-v1+json' \
--header 'content-type: application/json' \
--include

Response Body

The response returns true if a subscription exists or false otherwise.  Based on the example above, the response returns the following. NOTE: this command does NOT return Subscriber Data.  

HTTP/1.1 200 OK
Server: serverName
Content-Type: application/json
Link: <https://mail.mydomain.com/rest/lists/isSubscriberOnList/5?lastName=Doe&firstName=Jon>;
Date: Fri, 17 Jun 2016 12:54:44 GMT
{
 true
}

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
}

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk