API – Email Platform

Before using API, you need to go to the Settings > API settings window, set parameters and enable the API server

API server setup

First select the protocols . Two protocols are supported HTTP and secure HTTPS. The HTTPS protocol provides data encryption between the client and the API server, however, due to high overhead, it is slower than HTTP. You can enable one or both of the protocols to use. You also need to specify the port number that the API server will listen on. The default ports are 80 for HTTP and 443 for HTTPS. However, if you already have some software installed (for example, web server) that listens on the same port, when you start the server API, you will receive an error that the port is already busy. In this case, you can set any other free port and restart the server

if you want to use a secure HTTPS protocol, you can install an SSL certificate from a .pem or .pfx file by clicking the Install SSL Certificate button. By default, a self-signed certificate is used, which ensures the operation of the HTTPS server and encryption of communication, but when accessing the API URL from the browser, a warning will be issued that the self-signed certificate cannot be verified by the browser. If this moment is critical for you, you can use a real (paid) SSL certificate. RapidSend uses a PKCS#12 (*.pfx) certificate and saves it to %appdata%\RapidSend\Data\ApiServerSslCerts\Server.pfx

After all the settings have been set, click the Start API Server button

API URL, data format, authorization

To send API commands, use the URL http://127.0.0.1/api/v1 or https://127.0.0.1/api/v1 where 127.0.0.1 is the IP address of the computer (server). Content-Type for POST request should be application/json.

API uses data in JSON format according to the JSON-RPC 2.0 specification, detailed information about the specification is here: https://www.jsonrpc.org/specification

API command must contain the mandatory apiKey parameter, in which you must pass the API access key. API key can be found in API settings window (see screenshot above). Server API responses also conform to the JSON-RPC 2.0 specification

API commands

Sender Accounts

getSenderAccountsGet sender profiles List
getSenderAccountGet sender account details
addSenderAccountAdd sender account
editSenderAccontEdit sender account
deleteSenderAccountDelete sender account

getSenderAccounts

Returns available Sender Accounts.

CommandRequestRespond
apiKeycurl -X POST -H ‘Content-Type: application/json’
-i ‘http://127.0.0.1/api/v1’ –data ‘{
"jsonrpc": "2.0",
"method": "getSenderAccounts",
"params": {
"apiKey": "5EB20EC3-F672-XXXXXXXX"
},
"id": "1"
}

Note: In following examples, the call to the API
function is given in the conventional form for
the curl command. A clean request body,
without curl parameters, will look like this:
{"jsonrpc":"2.0",
"method":"getSenderAccounts", "params":
{"apiKey": "5EB20EC3-F672-4A26-8F65-
9FC162ED4EAB"},id":"1"}
{
"jsonrpc":"2.0",
"result":[
{
"id":1,
"accountName":"Example account 1",
"senderName":"Bill Gates",
"senderEmail":"[email protected]",
"replyToEmail":"[email protected]",
"organization":"Microsoft",
"espDomain":"domain.com"
},
{
"id":2,
"accountName":"Example account 2",
"senderName":"Jeff Bezos",
"senderEmail":"[email protected]",
"replyToEmail":"[email protected]",
"organization":"Amazon",
"espDomain":"somedomain.com"
}
],
"id":1
}

The command response contains an array with a list of available sender accounts:

Pay attention to the id parameter that is passed in the response. This is the unique identifier of the sender’s Account. It can be used later in the addMailing and editMailing commands to specify which Account should be used for the created/edited mailing list.

accountName – account name
senderName – from name (From:)
senderEmail – sender email address (From:)
replyToEmail – reply-to: email.
organization – organization.
espDomain – esp domain for signing the letter with the second DKIM signature.

Mailing Lists

getMailingListsGet mailing lists
addMailingListAdd mailing lists
editMailingListEdit mailing lists
deleteMailingListDelete mailing lists

getMailingLists

Returns available mailing lists.

CommandRequestRequest
apiKeycurl -X POST -H ‘Content-Type: application/json’
-i ‘http://127.0.0.1/api/v1’ –data '{
"jsonrpc":"2.0",
"method":"getMailingLists",
"params": {
"apiKey": " "5EB20EC3-F672-XXXXXXXX"
},
"id":"1"
}'
{
"jsonrpc":"2.0",
"result":[
{
"id":102,
"parentID":-1,
"listName":"Mailing Lists",
"size":0,
"lastMailing":""
},
{
"id":261,
"parentID":102,
"listName":"Example mail list",
"size":2,
"lastMailing":"14.09.2021"
},
{
"id":263,
"parentID":261,
"listName":"sub list 1",
"size":2,
"lastMailing":""
},
{
"id":264,
"parentID":261,
"listName":"sub list 2",
"size":0,
"lastMailing":""
}
],
"id":1
}

The command response contains an array with available mailing lists:

Pay attention to the id parameter that is passed in the response. This is the unique ID of the Mailing List. It can be used later in the addMailing and editMailing commands to specify which Mailing List should be used for the created/edited mailing list.

parentID – Parent list ID (using this field, mailing lists tree is built).
listName – mailing list name.
Size – number of addresses in the list
lastMailing – date of last list use in any Campaign

Messages

getMessagesGet Messages List
getMessageGet Message details
addMessageAdd Message
editMessageEdit Message
deleteMessageDelete Message

getMessages

Returns available messages

CommandRequestRespond
apiKeycurl -X POST -H ‘Content-Type: application/json’
-i ‘http://127.0.0.1/api/v1’ –data '{
"jsonrpc":"2.0",
"method":"getMessages",
"params": {
"apiKey": "5EB20EC3-F672-XXXXXX"
},
"id":"1"
}'
{
"jsonrpc":"2.0",
"result":[
{
"id":1,
"subject":"My message",
"messageName":"example message",
"messageType":"html",
"openTracking":true,
"clicksTracking":true
},
{
"id":2,
"subject":"my second message",
"messageName":"another message",
"messageType":"plainText",
"openTracking":false,
"clicksTracking":false
}
],
"id":1
}

The command response contains an array with available messages:

Pay attention to the id parameter that is passed in the response. This is the unique ID of the Mailing List. It can be used later in the addMailing and editMailing commands to specify which Mailing List should be used for the created/edited mailing list.

subject – email subject.
messageName – message name.
messageType – email type. html or plainText.
openTracking – openers tracking enabled .
clicksTracking – clicks tracking enabled.

Delivery Presets

getDeliveryPresetsGet Delivery Presets List
getDeliveryPresetGet Delivery Presets details
addDeliveryPresetAdd Delivery Preset
editDeliveryPresetEdit Delivery Preset
deleteDeliveryPresetDelete Delivery Preset

getDeliveryPresets

Returns available Delivery Presets

CommandRequestRespond
apiKeycurl -X POST -H ‘Content-Type: application/json’
-i ‘http://127.0.0.1/api/v1’ –data ‘{
“jsonrpc”:”2.0″,
“method”:”getDeliveryPresets”,
“params”: {“apiKey”: “5EB20EC3-XXXXXX”},
“id”:”1″
}’
{
"jsonrpc":"2.0",
"result":[
{
"id":1,
"name":"Example preset",
"sendingMethod":"personalCopy",
"deliveryMode":"relaysOnly",
"proxyUsed":false,
"sendingThreads":50
},
{
"id":2,
"name":"Another preset",
"sendingMethod":"personalCopy",
"deliveryMode":"builtInServerOnly",
"proxyUsed":true,
"sendingThreads":30
}
],
"id":1
}

The command response contains an array with available
Delivery Presets:

Pay attention to the id parameter that is passed in the response. This is the unique ID of the Mailing List. It can be used later in the addMailing and editMailing commands to specify which Mailing List should be used for the created/edited mailing list.

name – Delivery Preset name
sendingMethod – Sending Method: to, cc, bcc, personalCopy

deliveryMode – Delivery Mode:
relaysOnly (Only SMTP Relays),
relaysAndBuiltInServerOnErrors (SMTP relay, but SMTP server on error),
builtInServerAndRelaysOnErrors (Build in SMTP server, but SMTP relay on error),
builtInServerOnly (Only build in SMTP server).


proxyUsed – Is Proxy server enabled .
sendingThreads – Number of Threads

Campaigns

getMailingsGet Campaigns List
getMailingGet Campaign Details
addMailingAdd Campaign
editMailingEdit Campaign
deleteMailingDelete Campaign
startMailingStart Campaign
stopMailingStop Campaign

getMailings

CommandRequestRespond
apiKeycurl -X POST -H ‘Content-Type: application/json’ –
i ‘http://127.0.0.1/api/v1’ –data ‘{
“jsonrpc”:”2.0″,
“method”:”getMailings”,
“params”: {“apiKey”: “5EB20EC3-XXXXXX”},
“id”:”1″
}’
{
“jsonrpc”:”2.0″,
“result”:[
{
“id”:73,
“name”:”Example mailing”,
“type”:”mailing”,
“state”:”idle”,
“createDate”:”2021-09-13″,
“lastStartDate”:”2021-09-13T20:10:46″,
“approxSpeed”:”1460\/min”,
“lastStopByPostmaster”:false,
“enableCustomExcludeList”:true,
“customExcludeListID”:461,
“progressInfo”:{
“percentDone”:0,
“total”:26243,
“sent”:10432,
“notSent”:653,
“bad”:47,
“refused”:0,
“excluded”:0,
“opened”:826,
“clicks”:611
}
},
{
“id”:75,
“name”:”Example mail list validation”,
“type”:”validation”,
“state”:”idle”,
“createDate”:”2021-09-22″,
“lastStartDate”:””,
“approxSpeed”:”688\/min”,
“lastStopByPostmaster”:false,
“enableCustomExcludeList”:false,
“customExcludeListID”:0,
“progressInfo”:{
“percentDone”:100,
“total”:11266,
“good”:8960,
“bad”:1222,
“undetermined”:1084,
“excluded”:0
}
},
{
“id”:76,
“name”:”Example transactional mailing”,
“type”:”transactional”,
“state”:”idle”,
“createDate”:”2021-09-26″,
“lastStartDate”:””,
“approxSpeed”:”0\/min”,
“lastStopByPostmaster”:false,
“enableCustomExcludeList”:false,
“customExcludeListID”:0,
“progressInfo”:{
“jobsQueued”:0,
“contactsQueued”:0,
“total”:9142,
“sent”:5339,
“notSent”:121,
“bad”:0,
“refused”:0,
“excluded”:2841,
“opened”:916,
“clicks”:1265
}
}
],
“id”:1
}
The command response contains an array with available
campaigns:
Pay attention to the id parameter that is passed in the
response. This is the unique ID of the Mailing List. It can be
used later in the startMailing and stopMailing commands
start and stop Campaign
name – Campaign name
type – Campaign type:
mailing,
validation,
transactional
state – Campaign status
idle ,
working ,
stopping
createDate – Campaign create date
lastStartDate – last start date
approxSpeed – Average campaign sending date.
lastStopByPostmaster – Last campaign stop by
postmaster api
enableCustomExcludeList – Is campaign suppression list
enabled
customExcludeListID – Campaign suppression list ID
progressInfo – Information about campaign progress.
progressInfo array is depend on campaign type .

Transactional Campaign.

getTransactionalMailingsGet Transactional Campaigns
postSendingJobAdd Job to Transactional Campaign Queue
getSendingJobResultGet Job Result

Proxy

getProxyListsGet Proxy List
getProxiesSendingStatesGet Proxy Details
changeProxySendingOptionEdit Proxy

Web Tracking

getAmswebLinksGet Realtime Tracking Link List
addAmswebLinkAdd Realtime Tracking Link
editAmswebLinkEdit Realtime Tracking Link
deleteAmswebLinkDelete Realtime Tracking Link

Relays

getRelaysSendingStatesGet Relay Details
changeRelaySendingOptionEdit Relay

Scheduler

isSchedulerRunningCheck schedule status
runSchedulerRun Schedule