Introduction
This API returns the “unsubscribe” list – this is a “stop list” generated by end customers clicking on the the “Unsubscribe” link in the email.
It blocks the future sending of emails to that address. You can also add emails to this list using the POST Unsubscribe method.
Good to know
API response format:
Our APIs return data in either JSON or XML format (depending on request by .json or .xml). Only 100 records are returned in each call, increment the start parameter by 100 to fetch the next 100 from the list.
About this API
Resource Information
Response formats | JSON (default), XML |
HTTP method | GET |
Response family | Lists |
Header | Authorization: Bearer XXXXX |
Resource URL
Europe Production Server: https://api.eu.customergauge.com/v4.1/lists/unsubscribe.json
US Production Server: https://api.us.customergauge.com/v4.1/lists/unsubscribe.json
Australia Production Server: https://api.au.customergauge.com/v4.1/lists/unsubscribe.json
Authentication
OAuth2 Authentication is used to connect to this API. In order to create the Connected App, which is needed to generate the Access Token, Administrator access to CustomerGauge is needed. Once you've created your Connected App, you can acquire a Bearer Access Token by calling our OAuth2/Token API:
curl -X POST -H "Content-Type: application/x-www-form-urlencoded"
-d "grant_type=client_credentials&client_id={{ Client ID }}&client_secret={{ Client Secret }}"
https://auth.{{ apiRegion }}.customergauge.com/oauth2/token
The acquired Bearer Access Token is used in the Authorization header in your API request.
How to call
Parameters
date_range_from optional only if date_range_to is also not used. | Filter the data from date Example Values: 2012-09-01 |
date_range_to optional only if date_range_from is also not used. | Filter the data to date Example Values: 2012-10-01 |
start optional | default: 0 Example Values: 10 |
Example Requests
GET (json) | https://api.eu.customergauge.com/v4.1/lists/unsubscribe.json?date_range_from=2012-11-10&date_range_to=2014-10-19&start=100 |
GET (xml) | https://api.eu.customergauge.com/v4.1/lists/unsubscribe.xml?date_range_from=2012-11-10&date_range_to=2014-10-19&start=100 |
To call this API through cURL:
curl -H "Authorization: Bearer XXXXX" -X GET https://api.eu.customergauge.com/v4.1/lists/unsubscribe.xml?date_range_from=2012-11-10&date_range_to=2014-10-19&start=100
Example Result
Message reported on successful operation:
{
"Data":
[
{
"Email":"ingrid.wilkes@directness.net",
"Date":"2011-05-11 16:37:10",
"User":""
},
{
"Email":"ingrid.wilkes@directness.net",
"Date":"2011-05-11 16:37:14",
"User":""
},
{
"Email":"nuria.moreu@directness.net",
"Date":"2012-09-17 15:06:15",
"User":""
},
{
"Email":"test@test.com",
"Date":"2012-10-12 17:59:39",
"User":""
}
],
"Total_Records":4
}
Message reported on failed operation:
{
"Error": {
"Message": "Record does not exist",
"Code": 400401
}
}
Not the API you're looking for?
Related APIs:
APIs of the same family:
Or view: