Easy-SMTP API - Part I - Sending a Message

Follow

When using the Easy-SMTP API, the first step in your process will be the same: to retrieve your account's UUID.   

1. Getting your account UUID.  The account UUID is needed on most API endpoints available.  The first step in your API application should be to retrieve and store this string for future use.  The call to https://services.reachmail.net/administration/users/current will accomplish this.  If you are using one of the ReachMail API Wrappers, the function should have a similar if not identical in name.

Full documentation here: http://services.reachmail.net/#Administration@/administration/users/current

A call to https://services.reachmail.net/administration/users/current returns the following:

{
"AccountId": "00000000-0000-0000-0000-000000000000",
"AccountKey": "FAKECO",
"Username": "admin"
}

The account key is the is the friendly account name you use to log into the user interface and access this particular service call.  The account id is UUID needed for all subsequent API calls.  For instance, the call to https://services.reachmail.net/easysmtp/{AccountId} would in fact be https://services.reachmail.net/easysmtp/00000000-0000-0000-0000-000000000000.

2. Sending a message. Now that you have your account UUID, you can move on to the second step of scheduling the message.  

URI: https://services.reachmail.net/easysmtp/{AccountId}

Full Documentation here: http://services.reachmail.net/#EasySMTP@/easysmtp

This uses a POST method to provide the what is needed to make your email.  Here is an example of the JSON one might pass in:

{
"FromAddress": "from@reachmail.com",
"Recipients": [

{
"Address": "to@reachmail.com"
}
],

"Subject": "Test Subject Goes Here" ,

"Headers": {
"From": "Someone",
"X-Company": "Company Name",
"X-Location": "Chicago"
},

"BodyText": "this is the text version of the ES API test",
"BodyHtml": "this is the <a href=\"http://www.google.com\">HTML</a> version of the ES API test",
"Tracking": true
}

If successful, the status response is '200 OK'.  Additionally, you will also be provided with the following answer which includes the ID of your message, the number of address failures, an array of failed addresses, and the current send tally applied to your account for this delivery:

{
"Id": "00000000-0000-222-1111-000000000000",
"Failures": false,
"FailedAddresses": [],
"CurrentVolume": 1
}

API wrappers for assorted languages can be found here.  While not necessary, they may be helpful in getting started.

Have more questions? Submit a request

Comments

Powered by Zendesk