Get Subscription Status
1 min
GET
https://api.us1.odp.optimizely.com/v3/lists/subscriptions
Query Parameters
- identifiersmap<string, string>requiredExamplesEmail Identifier:
{ "email": "[email protected]" }Description
Responses
202
- undefinedExample
{ "customer": { "email": "[email protected]" }, "opted_in": true, "explicit_opt_in": true, "subscriptions": [ { "name": "True List Name", "list_id": "sample_list", "subscribed": true, "ts_status_updated": 1583868571 } ] }
400
- undefinedExample
{ "title": "Bad Request", "status": 400, "timestamp": "2018-09-10T21:07:10-05:00", "detail": { "invalids": [ { "field": "delimiter", "reason": "Unrecognized delimiter, valid options are comma, tab or pipe" } ] } }
403
- undefinedExample
{ "message": "Forbidden" }
404
- undefinedExample
{ "title": "Not Found", "status": 404, "timestamp": "2023-07-10T21:07:10-05:00", "detail": { "message": "Customer with email [email protected] was not found" } }
curl
curl --request GET \
--url 'https://api.us1.odp.optimizely.com/v3/lists/subscriptions?identifiers={%22email%22%3A%22customer%40email.com%22}' \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.us1.odp.optimizely.com/v3/lists/subscriptions?identifiers={\"email\":\"[email protected]\"}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.us1.odp.optimizely.com/v3/lists/subscriptions?identifiers={\"email\":\"[email protected]\"}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.us1.odp.optimizely.com/v3/lists/subscriptions?identifiers={\"email\":\"[email protected]\"}"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
202
// Accepted
"{ \"customer\": { \"email\": \"[email protected]\" }, \"opted_in\": true, \"explicit_opt_in\": true, \"subscriptions\": [ { \"name\": \"True List Name\", \"list_id\": \"sample_list\", \"subscribed\": true, \"ts_status_updated\": 1583868571 } ] }"400
// Bad Request
"{\"title\":\"Bad Request\",\"status\":400,\"timestamp\":\"2018-09-10T21:07:10-05:00\",\"detail\":{\"invalids\":[{\"field\":\"delimiter\",\"reason\":\"Unrecognized delimiter, valid options are comma, tab or pipe\"}]}}"403
// Forbidden
"{ \"message\": \"Forbidden\"}"404
// Not Found
"{ \"title\": \"Not Found\", \"status\": 404, \"timestamp\": \"2023-07-10T21:07:10-05:00\", \"detail\": { \"message\": \"Customer with email [email protected] was not found\" } }"