Create a tracking opt-out
1 min
POST
https://api.campaign.episerver.net/rest/{clientId}/recipients/trackingoptout
Path Parameters
- clientIdstringrequiredDescription
Form Parameters
- recipientIdstringrequiredDescription
Responses
201
406
curl
curl --request POST \
--url https://api.campaign.episerver.net/rest/{clientId}/recipients/trackingoptout \
--header 'accept: application/json' \
--header 'content-type: application/x-www-form-urlencoded' \
--data 'recipientId=string'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/x-www-form-urlencoded");
var urlencoded = new URLSearchParams();
urlencoded.append("recipientId", "string");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: urlencoded,
redirect: 'follow'
};
fetch("https://api.campaign.episerver.net/rest/{clientId}/recipients/trackingoptout", 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}/recipients/trackingoptout")
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"
request.body = "recipientId=string"
response = https.request(request)
puts response.read_body
python
import requests
url = "https://api.campaign.episerver.net/rest/{clientId}/recipients/trackingoptout"
payload = 'recipientId=string'
headers = {
'accept': 'application/json',
'content-type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
201
// The tracking opt-out was created.
406
// The tracking opt-out is not activated for this client. Ensure that the 'clientId' is correct and the required feature is enabled in the indicated client.