REST Email Marketing API Documentation

CONFIRMATIONS — SEND MANY

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.

HTTP VERB

POST

URL

/API/Rest/Confirmations/Send

ARGUMENTS

array of emailAddresses
documentName

Required permission

CreateEditMember

ERRORs

No Permission
Invalid document name
That document is not used for confirmations
No recipients found to send a confirmation
Database error
Unknown error

RETURNS

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"]}

EXAMPLE

Send many confirmations at once.

string message = "{'accountName':'acme','login':'ApiUser', 'password':'35tvbdsjs84whnwf4', 'emailAddresses':['sdgrgr@aol.com', 'dsvhsg6sds6d@yahoo.com', 'dfndfugdf7g@aol.com', 'dfgdfnfd67y@hotmail.com', 'fdsgfdgw54ge@yahoo.com', 'dfhfhe55@aol.com'], 'documentName':'SubscribeConfirmation'}";
string url = "http://example.com/api/rest/Confirmations/Send";

try
{
	System.Net.HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
	request.Method = "POST";
	request.ContentType = "application/json";
	request.ContentLength = message.Length;
	using (Stream webStream = request.GetRequestStream())
		using (StreamWriter requestWriter = new StreamWriter(webStream, System.Text.Encoding.ASCII))
			requestWriter.Write(message);

	System.Net.WebResponse webResponse = request.GetResponse();
	using (Stream webStream = webResponse.GetResponseStream())
		using (StreamReader responseReader = new StreamReader(webStream))
			Console.Out.WriteLine(responseReader.ReadToEnd());
}
catch (Exception e)
{
	System.Diagnostics.Debug.Fail(e.Message);
}
							
# encoding: utf-8
require 'rest-client'
require 'json'

url = 'http://www.acme.com/api/rest/Confirmations/Send'
args = {'accountName'=>'acme','login'=>'ApiUser', 'password'=>'sdf3w4tw','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 = "http://www.example.com/api/rest/Confirmations/Send";
args = {'accountName':'acme','login':'ApiUser', 'password':'sdf3w4tw','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 -X POST -H "Content-Type: application/json" -d "{'accountName':'acme','login':'ApiUser',
'password':'sdf3w4tw','emailAddresses':['sdgrgr@aol.com','dsvhsg6sds6d@yahoo.com',
'dfndfugdf7g@aol.com','dfgdfnfd67y@hotmail.com','fdsgfdgw54ge@yahoo.com','dfhfhe55@aol.com'],
'documentName':'SubscribeConfirmation'}" http://www.acme.com/api/rest/Confirmations/Send

Share this: