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
getSenderAccounts | Get sender profiles List |
getSenderAccount | Get sender account details |
addSenderAccount | Add sender account |
editSenderAccont | Edit sender account |
deleteSenderAccount | Delete sender account |
getSenderAccounts
Returns available Sender Accounts.
Command | Request | Respond |
---|---|---|
apiKey | curl -X POST -H ‘Content-Type: application/json’ -i ‘http://127.0.0.1/api/v1’ –data ‘ { ‘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", | { 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
getMailingLists | Get mailing lists |
addMailingList | Add mailing lists |
editMailingList | Edit mailing lists |
deleteMailingList | Delete mailing lists |
getMailingLists
Returns available mailing lists.
Command | Request | Request |
---|---|---|
apiKey | curl -X POST -H ‘Content-Type: application/json’ -i ‘http://127.0.0.1/api/v1’ –data '{ | { 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
getMessages | Get Messages List |
getMessage | Get Message details |
addMessage | Add Message |
editMessage | Edit Message |
deleteMessage | Delete Message |
getMessages
Returns available messages
Command | Request | Respond |
---|---|---|
apiKey | curl -X POST -H ‘Content-Type: application/json’ -i ‘http://127.0.0.1/api/v1’ –data '{ | { 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
getDeliveryPresets | Get Delivery Presets List |
getDeliveryPreset | Get Delivery Presets details |
addDeliveryPreset | Add Delivery Preset |
editDeliveryPreset | Edit Delivery Preset |
deleteDeliveryPreset | Delete Delivery Preset |
getDeliveryPresets
Returns available Delivery Presets
Command | Request | Respond |
---|---|---|
apiKey | curl -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″ }’ | { 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
getMailings | Get Campaigns List |
getMailing | Get Campaign Details |
addMailing | Add Campaign |
editMailing | Edit Campaign |
deleteMailing | Delete Campaign |
startMailing | Start Campaign |
stopMailing | Stop Campaign |
getMailings
Command | Request | Respond |
---|---|---|
apiKey | curl -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.
getTransactionalMailings | Get Transactional Campaigns |
postSendingJob | Add Job to Transactional Campaign Queue |
getSendingJobResult | Get Job Result |
Proxy
getProxyLists | Get Proxy List |
getProxiesSendingStates | Get Proxy Details |
changeProxySendingOption | Edit Proxy |
Web Tracking
getAmswebLinks | Get Realtime Tracking Link List |
addAmswebLink | Add Realtime Tracking Link |
editAmswebLink | Edit Realtime Tracking Link |
deleteAmswebLink | Delete Realtime Tracking Link |
Relays
getRelaysSendingStates | Get Relay Details |
changeRelaySendingOption | Edit Relay |
Scheduler
isSchedulerRunning | Check schedule status |
runScheduler | Run Schedule |