Send a test mailing
1 min
POST
https://api.campaign.episerver.net/rest/{clientId}/transactionalmail/{transactionalMailId}/test
Path Parameters
- clientIdinteger<int64>requiredDescriptionFormatint64
- transactionalMailIdinteger<int64>requiredDescriptionFormatint64
Header Parameters
- acceptstringDescriptionDefaultapplication/jsonAllowedapplication/jsonapplication/vnd.optivo.broadmail.v1+json
Form Parameters
- recipientIdsstring[]requiredDescription
- mimeTypestringExampleDescription
- subjectstringDescription
- senderAddressstringDescription
- recipientListIdstringrequiredDescription
Responses
202
- TestMailingStartedReport
- mailingIdinteger<int64>DescriptionFormatint64
- validRecipientAddressesstring[]Description
- userIdsOfRecipientsWithoutValidAddressesstring[]Description
- blacklistedRecipientAddressesstring[]Description
- linksobject[]
- uriBuilderobject
- relsstring[]
- relstring
- typestring
- paramsmap<string, string>
- titlestring
- uristring<uri>Formaturi
400
curl
curl --request POST \
--url https://api.campaign.episerver.net/rest/{clientId}/transactionalmail/{transactionalMailId}/test \
--header 'accept: application/json' \
--header 'content-type: application/x-www-form-urlencoded' \
--data 'recipientIds=array' \
--data 'recipientListId=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("recipientIds", "array");
urlencoded.append("recipientListId", "string");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: urlencoded,
redirect: 'follow'
};
fetch("https://api.campaign.episerver.net/rest/{clientId}/transactionalmail/{transactionalMailId}/test", 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}/transactionalmail/{transactionalMailId}/test")
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 = "recipientIds=array&recipientListId=string"
response = https.request(request)
puts response.read_body
python
import requests
url = "https://api.campaign.episerver.net/rest/{clientId}/transactionalmail/{transactionalMailId}/test"
payload = 'recipientIds=array&recipientListId=string'
headers = {
'accept': 'application/json',
'content-type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
202
// The test message was sent successfully. The response contains a report on the recipients included in the test mailing (check "validRecipientAddresses" field).
{
"mailingId": "",
"validRecipientAddresses": [
""
],
"userIdsOfRecipientsWithoutValidAddresses": [
""
],
"blacklistedRecipientAddresses": [
""
],
"links": [
{
"uriBuilder": {},
"rels": [
""
],
"rel": "",
"type": "",
"params": "",
"title": "",
"uri": ""
}
]
}400
// At least one request parameter is not valid