Update attribute values of recipients filtered by a target group
1 min
POST
https://api.campaign.episerver.net/rest/{clientId}/recipients/{recipientListId}/modify
Path Parameters
- clientIdinteger<int64>requiredDescriptionFormatint64
- recipientListIdinteger<int64>requiredDescriptionFormatint64
Header Parameters
- acceptstringDescriptionDefaultapplication/jsonAllowedapplication/jsonapplication/vnd.optivo.broadmail.v1+json
Form Parameters
- targetGroupinteger<int64>requiredDescriptionFormatint64
- datastringDescription
- modestring<set | prepend | append>DescriptionAllowedsetprependappend
Responses
200
- RestRecipient[]
- idstringDescription
- createdstring<date-time>DescriptionFormatdate-time
- modifiedstring<date-time>DescriptionFormatdate-time
- optInMailIdstringDescription
- linksobject[]Description
- uriBuilderobject
- relsstring[]
- relstring
- typestring
- paramsmap<string, string>
- titlestring
- uristring<uri>Formaturi
400
curl
curl --request POST \
--url https://api.campaign.episerver.net/rest/{clientId}/recipients/{recipientListId}/modify \
--header 'accept: application/json' \
--header 'content-type: application/x-www-form-urlencoded' \
--data 'targetGroup=integer<int64>'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("targetGroup", "integer<int64>");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: urlencoded,
redirect: 'follow'
};
fetch("https://api.campaign.episerver.net/rest/{clientId}/recipients/{recipientListId}/modify", 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/{recipientListId}/modify")
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 = "targetGroup=integer%3Cint64%3E"
response = https.request(request)
puts response.read_body
python
import requests
url = "https://api.campaign.episerver.net/rest/{clientId}/recipients/{recipientListId}/modify"
payload = 'targetGroup=integer%3Cint64%3E'
headers = {
'accept': 'application/json',
'content-type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// The recipient's attributes were updated.
[
{
"id": "",
"created": "",
"modified": "",
"optInMailId": "",
"links": [
{
"uriBuilder": {},
"rels": [
""
],
"rel": "",
"type": "",
"params": "",
"title": "",
"uri": ""
}
]
}
]400
// The target group is not provided or recipient's attribute is not recognized or its value cannot be parsed. Ensure that "target group" is added to the request and that the required parameters are correct.