Follow

Querying Lists

Your lists can be queried for the existence of an item in the list via API.

Query a Single List

Check a single list for the existence of an item.

Use an HTTP GET request to:

https://app.suppressionlist.com/exists/{{list_id}}/{{query term}}: 

Query

$ curl -X GET https://app.suppressionlist.com/exists/my_list/test@email.com \
-H 'Accept: application/json' \
-uAPI:fc36c8168cbb16784f6a29f89695dd92v

Query Term Found

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
 {
   "specified_lists":["my_list"],
   "key":"test@email.com",
   "found":true,
   "exists_in_lists":["my_list"]
 }

Query Term Not Found

HTTP/1.1 404 NOT FOUND
 Content-Type: application/json; charset=utf-8
 {
   "specified_lists": ["my_list"],
   "key":"test@email.com",
   "found":false
 }

Standardizing data

Upon receiving a item to add to a List or a term to query, SuppressionList will take the following steps:

  1. Strip all whitespace from the query string
  2. Downcase all characters in the query string
  3. MD5 hash the query string before performing the add or query.

Note that punctuation is not removed, only whitespace. So phone number formats, for example, are not standardized. We recommend that you standardize all data before adding it to a list as well as before querying. 

Querying Multiple Lists

You can also check for the existence of an item across multiple lists in a single query.

Use an HTTP GET request to:

https://app.suppressionlist.com/exists/{{list_id_1}}|{{list_id_2}}/{{query_term}}:

Query

$ curl -X GET https://app.suppressionlist.com/exists/my_list|my_other_list|my_third_list/test@email.com \
       -H 'Accept: application/json' \
       -uAPI:fc36c8168cbb16784f6a29f89695dd92

Query Term Found

 HTTP/1.1 200 OK
 Content-Type: application/json; charset=utf-8
 {
   "specified_lists":["my_list","my_other_list","my_third_list"],
   "key":"test@email.com",
   "found":true,
   "exists_in_lists":["my_list","my_third_list"]
 }

 

Query Term Not Found

 HTTP/1.1 404 Not Found
 Content-Type: application/json; charset=utf-8
 {
   "specified_lists": ["my_list","my_other_list","my_third_list"],
   "key":"test@email.com",
   "found":false
 }

 

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

Comments

You must be logged in to comment.