Add recipients to the internal unsubscribe list or unsubscribe recipients (max. 5000)
1 min
POST
https://api.campaign.episerver.net/rest/{clientId}/unsubscribes
Path Parameters
- clientIdstringrequiredDescription
Header Parameters
- acceptstringDescriptionDefaultapplication/jsonAllowedapplication/jsonapplication/vnd.optivo.broadmail.v1+json
Form Parameters
- recipientIdsstring[]Description
- mediaTypestring<EMAIL | FAX | SMS | LETTER | PUSH | PRINT>DescriptionAllowedEMAILFAXSMSLETTERPUSHPRINT
- mailIdsstring[]Description
- recipientListIdinteger<int64>DescriptionFormatint64
Responses
200
- RestUnsubscribesCreateResult
- successfulIdsstring[]Description
- unsuccessfulIdsstring[]Description
400
curl
curl --request POST \
--url https://api.campaign.episerver.net/rest/{clientId}/unsubscribes \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/x-www-form-urlencoded");
var requestOptions = {
method: 'POST',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.campaign.episerver.net/rest/{clientId}/unsubscribes", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "net/http"
url = URI("https://api.campaign.episerver.net/rest/{clientId}/unsubscribes")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/x-www-form-urlencoded"
response = https.request(request)
puts response.read_body
python
import requests
url = "https://api.campaign.episerver.net/rest/{clientId}/unsubscribes"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// At least one recipient was successfully added to the internal unsubscribe list. Please check the result for more details.
{
"successfulIds": [
""
],
"unsuccessfulIds": [
""
]
}400
// The recipients could not be unsubscribed. Ensure that you did not exceed the limit of 5000 IDs.