Send a transactional mail
1 min
POST
https://api.campaign.episerver.net/rest/{clientId}/transactionalmail/{transactionalMailId}/send
Path Parameters
- clientIdstringrequiredDescription
- transactionalMailIdinteger<int64>requiredDescriptionFormatint64
Header Parameters
- acceptstringDescriptionDefaultapplication/jsonAllowedapplication/jsonapplication/vnd.optivo.broadmail.v1+json
Form Parameters
- personalizedAttachmentsTokenstringDescription
- datastringDescription
- recipientIdstringrequiredDescription
- recipientListIdinteger<int64>requiredDescriptionFormatint64
Responses
202
- RestMailId
- mailIdstringDescription
400
curl
curl --request POST \
--url https://api.campaign.episerver.net/rest/{clientId}/transactionalmail/{transactionalMailId}/send \
--header 'accept: application/json' \
--header 'content-type: application/x-www-form-urlencoded' \
--data 'recipientId=string' \
--data 'recipientListId=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("recipientId", "string");
urlencoded.append("recipientListId", "integer<int64>");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: urlencoded,
redirect: 'follow'
};
fetch("https://api.campaign.episerver.net/rest/{clientId}/transactionalmail/{transactionalMailId}/send", 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}/send")
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&recipientListId=integer%3Cint64%3E"
response = https.request(request)
puts response.read_body
python
import requests
url = "https://api.campaign.episerver.net/rest/{clientId}/transactionalmail/{transactionalMailId}/send"
payload = 'recipientId=string&recipientListId=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)
202
// The transactional mail was accepted and is sent asynchronously. To retrieve the sending status of the transactional mail, use the returned mailId and the GET status operation.
{
"mailId": ""
}400
// The required recipientId/recipientListId is not provided and the recipient list is not assigned to the mailing. Add the required parameters and try again.