Send a confirmation document to many recipients. This implements the double-opt-in logic. Recipients in the confirmation status will not be sent additional emails until they confirm their interest. The Document name provided must exist in the system and be of type 'Confirm'. Only existing recipients can be sent a double-opt-in message — create the recipient before calling this routine.
POST
/API/Rest/Confirmations/Send
array of emailAddresses
documentName
CreateEditMember
No Permission
Invalid document name
That document is not used for confirmations
No recipients found to send a confirmation
Database error
Unknown error
Structure with invalidEmailAddresses array, alreadyConfirmed array, and duplicateInFile array. All other recipients will have been queued successfully.
The invalidEmailAddresses array holds those email addresses that haven't been added to the system yet.
The alreadyConfirmed array holds the recipients that have already confirmed, as there is no need to send to them again.
The duplicateInFile array holds those email addresses that were duplicated in the input file.
{"invalidEmailAddresses":["ddssdfasdfads@sdfasdf.com"],"alreadyConfirmed":["eli232323@example.com","efegdger@example.com","flynn@example.com","frank@example.com","frey@example.com"],"duplicateInFile":["frank@example.com"]}
Send many confirmations at once.
using System;
using System.Net.Http;
using System.Text;
string url = "https://example.com/API/Rest/Confirmations/Send";
string message = "{\"accountName\":\"acme\",\"login\":\"ApiUser\",\"password\":\"YOUR_PASSWORD\",\"emailAddresses\":[\"sdgrgr@aol.com\",\"dsvhsg6sds6d@yahoo.com\",\"dfndfugdf7g@aol.com\",\"dfgdfnfd67y@hotmail.com\",\"fdsgfdgw54ge@yahoo.com\",\"dfhfhe55@aol.com\"],\"documentName\":\"SubscribeConfirmation\"}";
// Reuse HttpClient for multiple requests in production code.
using (var client = new HttpClient())
using (var request = new HttpRequestMessage(HttpMethod.Post, url))
{
request.Content = new StringContent(message, Encoding.UTF8, "application/json");
using (HttpResponseMessage response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}
# encoding: utf-8
require 'rest-client'
require 'json'
url = 'https://example.com/API/Rest/Confirmations/Send'
args = {'accountName'=>'acme','login'=>'ApiUser', 'password'=>'YOUR_PASSWORD','emailAddresses'=>['sdgrgr@aol.com','dsvhsg6sds6d@yahoo.com', 'dfndfugdf7g@aol.com','dfgdfnfd67y@hotmail.com','fdsgfdgw54ge@yahoo.com','dfhfhe55@aol.com'], 'documentName'=>'Confirm1'}
response = RestClient.post(url, args.to_json, :content_type => "application/json;charset=utf-8")
puts response
import requests
url = "https://example.com/API/Rest/Confirmations/Send"
args = {'accountName':'acme','login':'ApiUser', 'password':'YOUR_PASSWORD','emailAddresses':['sdgrgr@aol.com','dsvhsg6sds6d@yahoo.com', 'dfndfugdf7g@aol.com','dfgdfnfd67y@hotmail.com','fdsgfdgw54ge@yahoo.com','dfhfhe55@aol.com'], 'documentName':'SubscribeConfirmation'}
resp = requests.post(url, json=args, headers={"Content-Type": "application/json"})
if resp.status_code == 200:
print(resp.text)
curl --request POST --header "Content-Type: application/json" --data '{"accountName":"acme","login":"ApiUser", "password":"YOUR_PASSWORD", "emailAddresses":["sdgrgr@aol.com", "dsvhsg6sds6d@yahoo.com", "dfndfugdf7g@aol.com", "dfgdfnfd67y@hotmail.com", "fdsgfdgw54ge@yahoo.com", "dfhfhe55@aol.com"], "documentName":"SubscribeConfirmation"}' "https://example.com/API/Rest/Confirmations/Send"