NAV Navbar
shell php java ruby python javascript json Json Response
  • Getting Started
  • Authentication
  • Message
  • Webhook
  • Domains
  • Getting Started

    AriticMail for PHP 
    This library helps you send e-mails through Ariticmail in PHP 5.4 and above.
    
    Installation
    Install the library using [Composer](https://getcomposer.org/):
    
    $ composer require ariticmail/ariticmail
    
    

    Welcome to the Aritic Mail API documentation! To simplify a developer's work, we at Aritic Mail have built developer-friendly APIs which are supported by the major programming languages to send, receive or track transactional emails.We support both standard SMTP protocol and HTTP WEB-API for integrating either a legacy application or a latest high-tech innovation. You can track all email statistics, and analytics of your email sent/processed, opens, clicks, bounces, and complaints.

    We have language bindings for PHP, Java, Shell, Ruby and Python! You can view code examples on the right side of this page and use the top right tabs to switch between different programming languages.

    Our APIs work over the HTTP protocol with JSON and build in an RPC-like manner, and you can do anything with the API's using their particular action provided. All the HTTP requests must be made over HTTPS URL given in the action defined in this documentation. All responses you receive from the API will return in JSON.

    Requests should be made using the POST method with any parameters encoded as JSON in the body of the request.

    Authentication

    To Authenticate with Aritic Mail you must have a valid Aritic Mail API key. You can download your API key from Aritic Mail dashboard, in case you don't have Aritic Mail account, please use the following link for Registration.

    Once you have an account with Aritic Mail, you can follow the simple instructions to create your API key Create API

    Aritic Mail expects for the API key to be included in all API requests to the server in a header that looks like the following:

    "X-Server-API-Key: f25232f0d4e1744ebaee"

    Message

    Send Message

    curl "https://mail.ariticmail.com/api/v1/send/message" \
      -X POST \
      -H "Accept:application/json" \
      -H "Content-Type:application/json" \
      -H "X-Server-API-Key:amXIx5LO9ZmqkAYkbpwfRrMUYgfwUtY" \
      -d "{to: ['toemail1@da.com', 'toemail2@da.com'],cc: ['ccemail1@da.com', 'ccemail2@da.com'],from: 'fromAddr@da.com',  subject: 'Sample AriticMail', HtmlBody: '<html><body><P>Sample message from AriticMail Transactional server </P></body></html>'}"
    
    example json request
    
    
    {
     "to": [
        'toemail1@da.com',
        'toemail2@da.com'
      ],
     "cc": [
        'ccemail1@da.com',
        'ccemail2@da.com'
      ],
     "from": 'fromAddr@da.com',
     "subject": 'Sample AriticMail',
     "html_body":'<html><body><P>Sample message from AriticMail Transactional server </P></body></html>',
     "plain_body": 'Sample message from AriticMail Transactional server',
     "attachments": [
       {
           "name": "file1.txt",
           "content_type":"text/plain",
           "data": "Hkj7bDgh85TeNbc9Azop"
       }
      ]
    }
    
    <? php // Create a new AriticMail client using the server key you generate in the web interface
    $client = new AriticMail\Client('https://mail.ariticmail.com/api/v1/send/message', 'your-api-key');
    
    // Create a new message
    $message = new AriticMail\SendMessage($client);
    $message->to('toaddr1@da.com');
    $message->to('toaddr2@da.com');
    $message->cc('ccaddr@eda.com');
    $message->bcc('secret@aritcmail.com');
    $message->from('fromaddr@ariticmail.com');
    $message->subject('Hi there!');
    $message->plainBody('Hello world!');
    $message->htmlBody('<p>Hello world!</p>');
    $message->header('X-PHP-Test', 'value');
    $message->attach('textmessage.txt', 'text/plain', 'Hello world!');
    
    // Send the message and get the result
    $result = $message->send();
    
    
       Ariticmail ariticMail = new Ariticmail("https://mail.ariticmail.com/api/v1/send/message", "API_KEY");
    
            SendMessage message = new SendMessage();
              message.setFrom("example@domain.tld");
              message.addTo("user@domain.tld");
              message.setSubject("This is an API example!");
              message.setPlainBody("This is the plain body.  Very plain.");
    
            ariticMail.sendMessage(message);
    
    This API client is coming soon. 
    If you are looking for ruby integration, please get in touch with our team. support@aritic.com
    
    This API client is coming soon.
    If you are looking for python integration, please get in touch with our team. support@aritic.com
    
    This API client is coming soon.
    If you are looking for javascript integration, please get in touch with our team. support@aritic.com
    

    Request URL

    https://mail.ariticmail.com/api/v1/send/message

    Request Headers

    Header Value
    Accept application/json
    Content-Type application/json
    x-server-api-key Please use KEY value under credentials

    Send Mail Request

    Field Name Field Type Field Value
    to Array List of To email addresses. Max 50
    cc Array List of CC email addresses. Max 50
    from String From email address. Must be of the verified domain
    Headers Array List of custom headers
    subject String Subject line of email
    plain_body String Plain text body of the email
    html_body String HTML body content of email
    reply_to String reply-to address of the email
    tag String This value will identify messages together
    attachments Array List of attachments
    Sample response format
    
    
    {
        "status": "success",
        "time": 0.1,
        "data": {
            "message_id": "8f51b1a5-3a02-4345-b6ea-e72b6f834d05@rp.mail.ariticmail.com",
            "messages": {
                "toemail1@da.com": {
                    "id": 857,
                    "token": "oA4YFkb2ibDx"
                }
            }
        }
     }
    
    <? php // Loop through each of the recipients to get the message ID
    foreach ($result->recipients() as $email => $message) {
        $email;            // The e-mail address of the recipient
        $message->id();    // Returns the message ID
        $message->token(); // Returns the message's token
    } 
    

    Send Mail Response

    Field Name Field Type Field Value
    status String Status of the mail handling
    time String Time taken to process mail
    message_id String Message ID for further tracking
    token String Token for each to/cc email address
    id String ID for each to/cc email address

    Get Opens

    curl --request POST \
      --url http://mail.ariticmail.com/api/v1/messages/open \
      --header 'cache-control: no-cache' \
      --header 'content-type: application/json' \
      --header 'x-server-api-key: nudY4CGIGh3rgDyB8iMqwert' \
      --data '{\n   "domain":"richa.com",\n "from_date":"2017-09-20",\n "to_date":"2017-09-23"\n}'
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('http://mail.ariticmail.com/api/v1/messages/open');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'x-server-api-key' => 'nudY4CGIGh3rgDyB8iMqwert',
      'content-type' => 'application/json'
    ));
    
    $request->setBody('{
        "domain":"richa.com",
        "from_date":"2017-09-20",
        "to_date":"2017-09-23"
    }');
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\n\t\"domain\":\"richa.com\",\n\t\"from_date\":\"2017-09-20\",\n\t\"to_date\":\"2017-09-23\"\n}");
    Request request = new Request.Builder()
      .url("http://mail.ariticmail.com/api/v1/messages/open")
      .post(body)
      .addHeader("content-type", "application/json")
      .addHeader("x-server-api-key", "nudY4CGIGh3rgDyB8iMqwert")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    import http.client
    
    conn = http.client.HTTPConnection("mail.ariticmail.com")
    
    payload = "{\n\t\"domain\":\"richa.com\",\n\t\"from_date\":\"2017-09-20\",\n\t\"to_date\":\"2017-09-23\"\n}"
    
    headers = {
        'content-type': "application/json",
        'x-server-api-key': "nudY4CGIGh3rgDyB8iMqwert",
        'cache-control': "no-cache"
        }
    
    conn.request("POST", "/api/v1/messages/open", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "http://mail.ariticmail.com/api/v1/messages/open",
      "method": "POST",
      "headers": {
        "content-type": "application/json",
        "x-server-api-key": "nudY4CGIGh3rgDyB8iMqwert",
        "cache-control": "no-cache"
      },
      "processData": false,
      "data": "{\n\t\"domain\":\"richa.com\",\n\t\"from_date\":\"2017-09-20\",\n\t\"to_date\":\"2017-09-23\"\n}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "domain":"richa.com",
        "from_date":"2017-09-20",
        "to_date":"2017-09-23"
    }
    
    {
        "status": "success",
        "time": 0.01,
        "flags": {},
        "data": {
            "open_count": {
                "data": [
                    {
                        "date": "2017-09-20",
                        "total_opens": 0,
                        "unique_opens": 0
                    },
                    {
                        "date": "2017-09-21",
                        "total_opens": 0,
                        "unique_opens": 0
                    },
                    {
                        "date": "2017-09-22",
                        "total_opens": 0,
                        "unique_opens": 0
                    },
                    {
                        "date": "2017-09-23",
                        "total_opens": 0,
                        "unique_opens": 0
                    },
                    {
                        "date": "2017-09-24",
                        "total_opens": 0,
                        "unique_opens": 0
                    }
                ],
                "total_opens": 0,
                "unique_opens": 0
            }
        }
    }
    
    require 'uri'
    require 'net/http'
    
    url = URI("http://mail.ariticmail.com/api/v1/messages/open")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["x-server-api-key"] = 'nudY4CGIGh3rgDyB8iMqwert'
    request["cache-control"] = 'no-cache'
    request.body = "{\n\t\"domain\":\"richa.com\",\n\t\"from_date\":\"2017-09-20\",\n\t\"to_date\":\"2017-09-23\"\n}"
    
    response = http.request(request)
    puts response.read_body
    

    You can get number of opens of message using the following code on the right panel.You will find response of the code under the Json Response tab.

    Request URL

    http://mail.ariticmail.com/api/v1/messages/open

    Request Headers

    Header Value
    Accept application/json
    Content-Type application/json
    x-server-api-key Please use KEY value under credentials

    Get Opens Request

    Field Name Field Type Field Value
    domain String Name of the domain to be created
    from_date String Start of range of date
    to_date String End of range of date

    Get Opens Response

    Field Name Field Type Field Value
    status String Status of creation of domain
    time String Time taken to return response
    flags Array Gives the list of flags if any
    open_count Array Lists the open status for all the dates provided in the range
    date String Date for which status is given
    total_opens String Total number of opens
    unique_opens String Total number of unique opens

    Get Clicks

    curl --request POST \
      --url http://mail.aritic.com/api/v1/messages/click \
      --header 'cache-control: no-cache' \
      --header 'content-type: application/json' \
      --header 'x-server-api-key: nudY4CGIGh3rgDyB8iMqwert' \
      --data '{\n   "domain":"richa.com",\n "from_date":"2017-09-20",\n "to_date":"2017-09-23"\n}'
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('http://mail.aritic.com/api/v1/messages/click');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'x-server-api-key' => 'nudY4CGIGh3rgDyB8iMqwert',
      'content-type' => 'application/json'
    ));
    
    $request->setBody('{
        "domain":"richa.com",
        "from_date":"2017-09-20",
        "to_date":"2017-09-23"
    }');
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\n\t\"domain\":\"richa.com\",\n\t\"from_date\":\"2017-09-20\",\n\t\"to_date\":\"2017-09-23\"\n}");
    Request request = new Request.Builder()
      .url("http://mail.aritic.com/api/v1/messages/click")
      .post(body)
      .addHeader("content-type", "application/json")
      .addHeader("x-server-api-key", "nudY4CGIGh3rgDyB8iMqwert")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("http://mail.aritic.com/api/v1/messages/click")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["x-server-api-key"] = 'nudY4CGIGh3rgDyB8iMqwert'
    request["cache-control"] = 'no-cache'
    request.body = "{\n\t\"domain\":\"richa.com\",\n\t\"from_date\":\"2017-09-20\",\n\t\"to_date\":\"2017-09-23\"\n}"
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPConnection("mail.aritic.com")
    
    payload = "{\n\t\"domain\":\"richa.com\",\n\t\"from_date\":\"2017-09-20\",\n\t\"to_date\":\"2017-09-23\"\n}"
    
    headers = {
        'content-type': "application/json",
        'x-server-api-key': "nudY4CGIGh3rgDyB8iMqwert",
        'cache-control': "no-cache"
        }
    
    conn.request("POST", "/api/v1/messages/click", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "http://mail.aritic.com/api/v1/messages/click",
      "method": "POST",
      "headers": {
        "content-type": "application/json",
        "x-server-api-key": "nudY4CGIGh3rgDyB8iMqwert",
        "cache-control": "no-cache"
      },
      "processData": false,
      "data": "{\n\t\"domain\":\"richa.com\",\n\t\"from_date\":\"2017-09-20\",\n\t\"to_date\":\"2017-09-23\"\n}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "domain":"richa.com",
        "from_date":"2017-09-20",
        "to_date":"2017-09-23"
    }
    
    {
        "status": "success",
        "time": 0.07,
        "flags": {},
        "data": {
            "click_count": {
                "data": [
                    {
                        "date": "2017-09-20",
                        "total_opens": 0,
                        "unique_opens": 0
                    },
                    {
                        "date": "2017-09-21",
                        "total_opens": 1,
                        "unique_opens": 1
                    },
                    {
                        "date": "2017-09-22",
                        "total_opens": 0,
                        "unique_opens": 0
                    },
                    {
                        "date": "2017-09-23",
                        "total_opens": 0,
                        "unique_opens": 0
                    },
                    {
                        "date": "2017-09-24",
                        "total_opens": 0,
                        "unique_opens": 0
                    }
                ],
                "total_clicks": 1,
                "unique_clicks": 1
            }
        }
    }
    
    
    

    You can get number of clicks of message using the following code on the right panel.You will find response of the code under the Json Response tab.

    Request URL

    http://mail.ariticmail.com/api/v1/messages/click

    Request Headers

    Header Value
    Accept application/json
    Content-Type application/json
    x-server-api-key Please use KEY value under credentials

    Get Clicks Request

    Field Name Field Type Field Value
    domain String Name of the domain to be created
    from_date String Start of range of date
    to_date String End of range of date

    Get Clicks Response

    Field Name Field Type Field Value
    status String Status of creation of domain
    time String Time taken to return response
    flags Array Gives the list of flags if any
    click_count Array Lists the click status for all the dates provided in the range
    date String Date for which status is given
    total_opens String Total number of opens
    unique_opens String Total number of unique opens
    total_clicks String Total number of clicks
    unique_clicks String Total number of unique clicks

    Get Sent

    curl --request POST \
      --url http://mail.ariticmail.com/api/v1/messages/sent \
      --header 'cache-control: no-cache' \
      --header 'content-type: application/json' \
      --header 'x-server-api-key: nudY4CGIGh3rgDyB8iMqwert' \
      --data '{\n   "domain":"richa.com",\n "from_date":"2017-09-20",\n "to_date":"2017-09-23"\n}'
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('http://mail.ariticmail.com/api/v1/messages/sent');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'x-server-api-key' => 'nudY4CGIGh3rgDyB8iMqwert',
      'content-type' => 'application/json'
    ));
    
    $request->setBody('{
        "domain":"richa.com",
        "from_date":"2017-09-20",
        "to_date":"2017-09-23"
    }');
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\n\t\"domain\":\"richa.com\",\n\t\"from_date\":\"2017-09-20\",\n\t\"to_date\":\"2017-09-23\"\n}");
    Request request = new Request.Builder()
      .url("http://mail.ariticmail.com/api/v1/messages/sent")
      .post(body)
      .addHeader("content-type", "application/json")
      .addHeader("x-server-api-key", "nudY4CGIGh3rgDyB8iMqwert")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("http://mail.ariticmail.com/api/v1/messages/sent")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["x-server-api-key"] = 'nudY4CGIGh3rgDyB8iMqwert'
    request["cache-control"] = 'no-cache'
    request.body = "{\n\t\"domain\":\"richa.com\",\n\t\"from_date\":\"2017-09-20\",\n\t\"to_date\":\"2017-09-23\"\n}"
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPConnection("mail.ariticmail.com")
    
    payload = "{\n\t\"domain\":\"richa.com\",\n\t\"from_date\":\"2017-09-20\",\n\t\"to_date\":\"2017-09-23\"\n}"
    
    headers = {
        'content-type': "application/json",
        'x-server-api-key': "nudY4CGIGh3rgDyB8iMqwert",
        'cache-control': "no-cache"
        }
    
    conn.request("POST", "/api/v1/messages/sent", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "http://mail.ariticmail.com/api/v1/messages/sent",
      "method": "POST",
      "headers": {
        "content-type": "application/json",
        "x-server-api-key": "nudY4CGIGh3rgDyB8iMqwert",
        "cache-control": "no-cache"
      },
      "processData": false,
      "data": "{\n\t\"domain\":\"richa.com\",\n\t\"from_date\":\"2017-09-20\",\n\t\"to_date\":\"2017-09-23\"\n}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "domain":"richa.com",
        "from_date":"2017-09-20",
        "to_date":"2017-09-23"
    }
    
    {
        "status": "success",
        "time": 0,
        "flags": {},
        "data": {
            "sent_count": {
                "data": [
                    {
                        "date": "2017-09-20",
                        "total_sent": 0
                    },
                    {
                        "date": "2017-09-21",
                        "total_sent": 0
                    },
                    {
                        "date": "2017-09-22",
                        "total_sent": 0
                    },
                    {
                        "date": "2017-09-23",
                        "total_sent": 0
                    },
                    {
                        "date": "2017-09-24",
                        "total_sent": 0
                    }
                ],
                "total_sent": 0
            }
        }
    }
    

    You can get number of sent messages using the following code on the right panel.You will find response of the code under the Json Response tab.

    Request URL

    http://mail.ariticmail.com/api/v1/messages/sent

    Request Headers

    Header Value
    Accept application/json
    Content-Type application/json
    x-server-api-key Please use KEY value under credentials

    Get Sent Request

    Field Name Field Type Field Value
    domain String Name of the domain to be created
    from_date String Start of range of date
    to_date String End of range of date

    Get Sent Response

    Field Name Field Type Field Value
    status String Status of creation of domain
    time String Time taken to return response
    flags Array Gives the list of flags if any
    sent_count Array Lists the sent status for all the dates provided in the range
    date String Date for which status is given
    total_sent String Total number of sent messages

    Get Soft Bounce

    curl --request POST \
      --url http://mail.ariticmail.com/api/v1/messages/bounced_soft \
      --header 'cache-control: no-cache' \
      --header 'content-type: application/json' \
      --header 'x-server-api-key: nudY4CGIGh3rgDyB8iMqwert' \
      --data '{\n   "domain":"richa.com",\n "from_date":"2017-09-20",\n "to_date":"2017-09-23"\n}'
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('http://mail.ariticmail.com/api/v1/messages/bounced_soft');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'x-server-api-key' => 'nudY4CGIGh3rgDyB8iMqwert',
      'content-type' => 'application/json'
    ));
    
    $request->setBody('{
        "domain":"richa.com",
        "from_date":"2017-09-20",
        "to_date":"2017-09-23"
    }');
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\n\t\"domain\":\"richa.com\",\n\t\"from_date\":\"2017-09-20\",\n\t\"to_date\":\"2017-09-23\"\n}");
    Request request = new Request.Builder()
      .url("http://mail.ariticmail.com/api/v1/messages/bounced_soft")
      .post(body)
      .addHeader("content-type", "application/json")
      .addHeader("x-server-api-key", "nudY4CGIGh3rgDyB8iMqwert")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("http://mail.ariticmail.com/api/v1/messages/bounced_soft")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["x-server-api-key"] = 'nudY4CGIGh3rgDyB8iMqwert'
    request["cache-control"] = 'no-cache'
    request.body = "{\n\t\"domain\":\"richa.com\",\n\t\"from_date\":\"2017-09-20\",\n\t\"to_date\":\"2017-09-23\"\n}"
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPConnection("mail.ariticmail.com")
    
    payload = "{\n\t\"domain\":\"richa.com\",\n\t\"from_date\":\"2017-09-20\",\n\t\"to_date\":\"2017-09-23\"\n}"
    
    headers = {
        'content-type': "application/json",
        'x-server-api-key': "nudY4CGIGh3rgDyB8iMqwert",
        'cache-control': "no-cache"
        }
    
    conn.request("POST", "/api/v1/messages/bounced_soft", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "http://mail.ariticmail.com/api/v1/messages/bounced_soft",
      "method": "POST",
      "headers": {
        "content-type": "application/json",
        "x-server-api-key": "nudY4CGIGh3rgDyB8iMqwert",
        "cache-control": "no-cache"
      },
      "processData": false,
      "data": "{\n\t\"domain\":\"richa.com\",\n\t\"from_date\":\"2017-09-20\",\n\t\"to_date\":\"2017-09-23\"\n}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "domain":"richa.com",
        "from_date":"2017-09-20",
        "to_date":"2017-09-23"
    }
    
    {
        "status": "success",
        "time": 0,
        "flags": {},
        "data": {
            "soft_bounce_count": {
                "data": [
                    {
                        "date": "2017-09-20",
                        "total_soft_bounce": 0
                    },
                    {
                        "date": "2017-09-21",
                        "total_soft_bounce": 0
                    },
                    {
                        "date": "2017-09-22",
                        "total_soft_bounce": 0
                    },
                    {
                        "date": "2017-09-23",
                        "total_soft_bounce": 0
                    },
                    {
                        "date": "2017-09-24",
                        "total_soft_bounce": 0
                    }
                ],
                "total_soft_bounce": 0
            }
        }
    }
    

    You can get number of soft bounces of messages using the following code on the right panel.You will find response of the code under the Json Response tab.

    Request URL

    http://mail.ariticmail.com/api/v1/messages/bounced_soft

    Request Headers

    Header Value
    Accept application/json
    Content-Type application/json
    x-server-api-key Please use KEY value under credentials

    Get Soft Bounces Request

    Field Name Field Type Field Value
    domain String Name of the domain to be created
    from_date String Start of range of date
    to_date String End of range of date

    Get Soft Bounces Response

    Field Name Field Type Field Value
    status String Status of creation of domain
    time String Time taken to return response
    flags Array Gives the list of flags if any
    soft_bounce_count Array Lists the soft bounces status for all the dates provided in the range
    date String Date for which status is given
    total_soft_bounce String Total number of soft bounces

    Get Hard Bounce

    curl --request POST \
      --url http://mail.ariticmail.com/api/v1/messages/bounced_hard \
      --header 'cache-control: no-cache' \
      --header 'content-type: application/json' \
      --header 'x-server-api-key: nudY4CGIGh3rgDyB8iMqwert' \
      --data '{\n   "domain":"richa.com",\n "from_date":"2017-09-20",\n "to_date":"2017-09-23"\n}'
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('http://mail.ariticmail.com/api/v1/messages/bounced_hard');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'x-server-api-key' => 'nudY4CGIGh3rgDyB8iMqwert',
      'content-type' => 'application/json'
    ));
    
    $request->setBody('{
        "domain":"richa.com",
        "from_date":"2017-09-20",
        "to_date":"2017-09-23"
    }');
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\n\t\"domain\":\"richa.com\",\n\t\"from_date\":\"2017-09-20\",\n\t\"to_date\":\"2017-09-23\"\n}");
    Request request = new Request.Builder()
      .url("http://mail.ariticmail.com/api/v1/messages/bounced_hard")
      .post(body)
      .addHeader("content-type", "application/json")
      .addHeader("x-server-api-key", "nudY4CGIGh3rgDyB8iMqwert")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("http://mail.ariticmail.com/api/v1/messages/bounced_hard")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["x-server-api-key"] = 'nudY4CGIGh3rgDyB8iMqwert'
    request["cache-control"] = 'no-cache'
    request.body = "{\n\t\"domain\":\"richa.com\",\n\t\"from_date\":\"2017-09-20\",\n\t\"to_date\":\"2017-09-23\"\n}"
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPConnection("mail.ariticmail.com")
    
    payload = "{\n\t\"domain\":\"richa.com\",\n\t\"from_date\":\"2017-09-20\",\n\t\"to_date\":\"2017-09-23\"\n}"
    
    headers = {
        'content-type': "application/json",
        'x-server-api-key': "nudY4CGIGh3rgDyB8iMqwert",
        'cache-control': "no-cache"
        }
    
    conn.request("POST", "/api/v1/messages/bounced_hard", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "http://mail.ariticmail.com/api/v1/messages/bounced_hard",
      "method": "POST",
      "headers": {
        "content-type": "application/json",
        "x-server-api-key": "nudY4CGIGh3rgDyB8iMqwert",
        "cache-control": "no-cache"
      },
      "processData": false,
      "data": "{\n\t\"domain\":\"richa.com\",\n\t\"from_date\":\"2017-09-20\",\n\t\"to_date\":\"2017-09-23\"\n}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "domain":"richa.com",
        "from_date":"2017-09-20",
        "to_date":"2017-09-23"
    }
    
    {
        "status": "success",
        "time": 0,
        "flags": {},
        "data": {
            "hard_bounce_count": {
                "data": [
                    {
                        "date": "2017-09-20",
                        "total_hard_bounce": 0
                    },
                    {
                        "date": "2017-09-21",
                        "total_hard_bounce": 0
                    },
                    {
                        "date": "2017-09-22",
                        "total_hard_bounce": 0
                    },
                    {
                        "date": "2017-09-23",
                        "total_hard_bounce": 0
                    },
                    {
                        "date": "2017-09-24",
                        "total_hard_bounce": 0
                    }
                ],
                "total_hard_bounce": 0
            }
        }
    }
    

    You can get number of hard bounces of messages using the following code on the right panel.You will find response of the code under the Json Response tab.

    Request URL

    http://mail.ariticmail.com/api/v1/messages/bounced_hard

    Request Headers

    Header Value
    Accept application/json
    Content-Type application/json
    x-server-api-key Please use KEY value under credentials

    Get Hard Bounces Request

    Field Name Field Type Field Value
    domain String Name of the domain to be created
    from_date String Start of range of date
    to_date String End of range of date

    Get Hard Bounces Response

    Field Name Field Type Field Value
    status String Status of creation of domain
    time String Time taken to return response
    flags Array Gives the list of flags if any
    hard_bounce_count Array Lists the hard bounce status for all the dates provided in the range
    date String Date for which status is given
    total_hard_bounce String Total number of hard bounces

    Webhook

    One can configure multiple webhooks in AriticMail customer console. After login to customer console, click "Webhooks" in left menu. Then start configuring webhooks for various mail events.

    Below are few of the Webhooks one can define in AriticMail customer console.

    MessageSent

    {
      "message": {
        "id": 8382,
        "token": "RLwvwgrnKXQP",
        "direction": "outgoing",
        "message_id": "9c2bd44c1dc74a08316e5567ca639ece@da.com",
        "to": "test@xyz.com",
        "from": "support@da.com",
        "subject": "Please confirm your account!",
        "timestamp": 1509343741.77381,
        "spam_status": "NotSpam",
        "tag": null,
        "campaign_uid": null,
        "subscriber_uid": null,
        "list_uid": null
      },
      "status": "Sent",
      "details": "Message for test@xyz.com accepted by mx.zoho.com (204.141.32.121) (from 145.239.111.227)",
      "output": "250 Message received\n",
      "sent_with_ssl": false,
      "timestamp": 1509343751.0936499,
      "time": 3.65
    }
    

    Data is posted on this hook when ever an incoming message is delivered successfully to the recipient.

    MessageDelayed

    {
      "message": {
        "id": 7728,
        "token": "TEGFbVbwINLz",
        "direction": "outgoing",
        "message_id": "7b582c48275947e47204284f76e611e9@da.com",
        "to": "seaba@xyz.com",
        "from": "support@da.com",
        "subject": "Track your order id 345",
        "timestamp": 1509137341.648014,
        "spam_status": "NotSpam",
        "tag": null,
        "campaign_uid": null,
        "subscriber_uid": null,
        "list_uid": null
      },
      "status": "SoftFail",
      "details": "No SMTP servers were available for xyz.com. Tried 45.79.xxx.xxx",
      "output": "Could not resolve 45.79.xxx.xxx",
      "sent_with_ssl": null,
      "timestamp": 1509146699.131894,
      "time": null
    }
    

    Data is posted on to this webhook when ever any incoming message is not accepted by receiving mail box. Or delivery delayed due to any other reason. Message will be automatically retired for delivery.

    MessageDeliveryFailed

    {
      "message": {
        "id": 5965,
        "token": "LXZVQJx8XfPm",
        "direction": "outgoing",
        "message_id": "e1c2d84a-986b-4884-bba1-dd1c7f7ba42d@da.com",
        "to": "lfdsdsddf@gmail.com",
        "from": "support@da.com",
        "subject": "Weekly update on QA",
        "timestamp": 1508773234.687187,
        "spam_status": "NotSpam",
        "tag": null,
        "campaign_uid": null,
        "subscriber_uid": null,
        "list_uid": null
      },
      "status": "HardFail",
      "details": "Permanent SMTP delivery error when sending to gmail-smtp-in.l.google.com (74.125.133.26)",
      "output": "550-5.1.1 The email account that you tried to reach does not exist. Please try\n550-5.1.1 double-checking the recipient's email address for typos or\n550-5.1.1 unnecessary spaces. Learn more at\n550 5.1.1  https://support.google.com/mail/?p=NoSuchUser v203si1932318wmv.252 - gsmtp\n",
      "sent_with_ssl": false,
      "timestamp": 1508773234.9658422,
      "time": 0.12
    }
    

    Date is posted onto this webhook when a message delivery is permanently failed.

    MessageHeld

    {
      "message": {
        "id": 7156,
        "token": "sm6v36Y7Gh9y",
        "direction": "outgoing",
        "message_id": "5af89d3c69151d52b04617ceb587c9f6@da.com",
        "to": "daniel@xyz.com",
        "from": "support@da.com",
        "subject": "D102 account Status",
        "timestamp": 1509030603.179303,
        "spam_status": "NotChecked",
        "tag": null,
        "campaign_uid": null,
        "subscriber_uid": null,
        "list_uid": null
      },
      "status": "Held",
      "details": "Recipient (daniel@xyz.com) is on the suppression list (reason: too many hard fails)",
      "output": "",
      "sent_with_ssl": null,
      "timestamp": 1509030603.1926966,
      "time": null
    }
    

    Data is posted onto this webhool when a message is held in AriticMail server. A message is held at AriticMail server either because of Limit being reached or Server is in Development mode.

    MessageBounced

    {
      "message": {
        "id": 8540,
        "token": "Oa5T5l435fCh",
        "direction": "outgoing",
        "message_id": "95cb58b4f4eb2691e669b7964f4ebe97@da.com",
        "to": "davidwest19912@hotmail.com",
        "from": "rahul@da.com",
        "subject": "Nov billing",
        "timestamp": 1509359707.235345,
        "spam_status": "NotSpam",
        "tag": null,
        "campaign_uid": " lv847rrb12af6",
        "subscriber_uid": "rs198z9k7of09",
        "list_uid": "tq269pyrjj472"
      },
      "status": "HardFail",
      "details": "Permanent SMTP delivery error when sending to hotmail-com.olc.protection.outlook.com (104.47.38.33)",
      "output": "550 5.5.0 Requested action not taken: mailbox unavailable. [BL2NAM02FT028.eop-nam02.prod.protection.outlook.com]\n",
      "sent_with_ssl": false,
      "timestamp": 1509359727.1565595,
      "time": 10.82
    }
    

    Data is posted onto this webhook when a message is bounced. One can have this webhook configured as bounce handler as well.

    MessageLinkClicked

    {
      "url": "http://clickcapture.xyz.com/lists/tq269pyrjj472/unsubscribe/rs198z9k7of09/hk237jpk9kc4b",
      "token": "Av4mrAhT",
      "ip_address": "103.253.168.9",
      "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36",
      "message": {
        "id": 8536,
        "token": "m0DcnFUxGbBf",
        "direction": "outgoing",
        "message_id": "0235fbf94f8ee137dc4f25e93b1226c5@da.com",
        "to": "xyz@gmail.com",
        "from": "rahul@da.com",
        "subject": "About Mahatama Gandhi",
        "timestamp": 1509359047.152763,
        "spam_status": "NotSpam",
        "tag": null,
        "campaign_uid": " hk237jpk9kc4b",
        "subscriber_uid": "rs198z9k7of09",
        "list_uid": "tq269pyrjj472"
      }
    }
    

    Data is posted onto this webhook when ever a link in sent message is clicked. One can configure this webhook to listen to message click events.

    DomainDNSError

    {
      "server": {
        "uuid": "0000e1f3-1e98-06bc-474c-b7200000bd17",
        "name": "Ariti Mail Applications",
        "permalink": "xyz-server",
        "organization": "xyz6492"
      },
      "domain": "xyz.co.in",
      "uuid": "652a3524-ac2d-4c27-a283-bf9c1eea86c4",
      "dns_checked_at": 1509355010.936453,
      "spf_status": "Missing",
      "spf_error": "No SPF record exists for this domain",
      "dkim_status": "Missing",
      "dkim_error": "No TXT records were returned for mailer-m8njeX._domainkey.xyz.co.in",
      "mx_status": "Missing",
      "mx_error": "There are no MX records for xyz.co.in",
      "return_path_status": "Missing",
      "return_path_error": "There is no return path record at amrp.xyz.co.in"
    }
    

    Data is posted onto this webhook when AriticMail server notices issue with DNS configuration of any of the Domains activated for mail delivery.

    Domains

    You can create multiple domains using Aritic Mail customer console. After login to customer console, click "Domains" in left menu. Then start configuring domains for various mail events.

    There are few actions you can do using Domains.

    Create Domain

    curl --request POST \
      --url http://mail.ariticmail.com/api/v1/sendingdomain/add \
      --header 'cache-control: no-cache' \
      --header 'content-type: application/json' \
      --header 'x-server-api-key: nudY4CGIGh3rgDyB8iMqwert' \
      --data '{\n   "domain":"richa.com"\n}'
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('http://mail.ariticmail.com/api/v1/sendingdomain/add');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'x-server-api-key' => 'nudY4CGIGh3rgDyB8iMqwert',
      'content-type' => 'application/json'
    ));
    
    $request->setBody('{
        "domain":"richa.com"
    }');
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\n\t\"domain\":\"richa.com\"\n}");
    Request request = new Request.Builder()
      .url("http://mail.ariticmail.com/api/v1/sendingdomain/add")
      .post(body)
      .addHeader("content-type", "application/json")
      .addHeader("x-server-api-key", "nudY4CGIGh3rgDyB8iMqwert")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("http://mail.ariticmail.com/api/v1/sendingdomain/add")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["x-server-api-key"] = 'nudY4CGIGh3rgDyB8iMqwert'
    request["cache-control"] = 'no-cache'
    request.body = "{\n\t\"domain\":\"richa.com\"\n}"
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPConnection("mail.ariticmail.com")
    
    payload = "{\n\t\"domain\":\"richa.com\"\n}"
    
    headers = {
        'content-type': "application/json",
        'x-server-api-key': "nudY4CGIGh3rgDyB8iMqwert",
        'cache-control': "no-cache"
        }
    
    conn.request("POST", "/api/v1/sendingdomain/add", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "http://mail.ariticmail.com/api/v1/sendingdomain/add",
      "method": "POST",
      "headers": {
        "content-type": "application/json",
        "x-server-api-key": "nudY4CGIGh3rgDyB8iMqwert",
        "cache-control": "no-cache"
      },
      "processData": false,
      "data": "{\n\t\"domain\":\"richa.com\"\n}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "domain":"richa.com"
    }
    
    {
        "status": "success",
        "time": 0.03,
        "flags": {},
        "data": {
            "domain_id": 179,
            "server_id": 99,
            "spf_record": "v=spf1 a mx include:ariticmailmta.com ~all",
            "dkim_record_name": "mailer-zOpIRb._domainkey",
            "dkim_record": "v=DKIM1; t=s; h=sha256; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCxkhJhz62BXiNoQ6/S9MEuNhfssqzjBPwJYCIuQc3qY700I2Jq92TFjgJsK16XO8629WrmIkMBaAnQPInnt0aYQc+KQX9ISteViYUBA4qxIfT0/Q3STD1OgsxwDU9iI1h2wTfY2CJJYb3/zMk9sMnQGOz6umyNMpW5E7OeorH43wIDAQAB;",
            "cname_record": "amrp.richa.com",
            "hostname": "rp.mail.ariticmail.com",
            "mx_records": "mail.ariticmail.com"
        }
    }
    

    You can create new domain using the following code on the right panel.You will find response of the code under the Json Response tab.

    Request URL

    http://mail.ariticmail.com/api/v1/sendingdomain/add

    Request Headers

    Header Value
    Accept application/json
    Content-Type application/json
    x-server-api-key Please use KEY value under credentials

    Create Domain Request

    Field Name Field Type Field Value
    domain String Name of the domain to be created

    Create Domain Response

    Field Name Field Type Field Value
    status String Status of creation of domain
    time String Time taken to return response
    flags Array Gives the list of flags if any
    domain_id String Domain ID of the created domain
    server_id String Server ID dedicated to the domain created
    spf_record String Displays the SPF record for your DNS
    dkim_record_name String Displays the DKIM record name
    dkim_record String Displays the DKIM record
    cname_record String Displays the CNAME record
    hostname String Displays the hostname
    mx_records String Displays the Mail Server

    Verify Domain

    curl --request POST \
      --url http://mail.ariticmail.com/api/v1/sendingdomain/verify \
      --header 'cache-control: no-cache' \
      --header 'content-type: application/json' \
      --header 'x-server-api-key: nudY4CGIGh3rgDyB8iMqwert' \
      --data '{\n   "domain":"richa.com"\n}'
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('http://mail.ariticmail.com/api/v1/sendingdomain/verify');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'x-server-api-key' => 'nudY4CGIGh3rgDyB8iMqwert',
      'content-type' => 'application/json'
    ));
    
    $request->setBody('{
        "domain":"richa.com"
    }');
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\n\t\"domain\":\"richa.com\"\n}");
    Request request = new Request.Builder()
      .url("http://mail.ariticmail.com/api/v1/sendingdomain/verify")
      .post(body)
      .addHeader("content-type", "application/json")
      .addHeader("x-server-api-key", "nudY4CGIGh3rgDyB8iMqwert")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("http://mail.ariticmail.com/api/v1/sendingdomain/verify")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["x-server-api-key"] = 'nudY4CGIGh3rgDyB8iMqwert'
    request["cache-control"] = 'no-cache'
    request.body = "{\n\t\"domain\":\"richa.com\"\n}"
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPConnection("mail.ariticmail.com")
    
    payload = "{\n\t\"domain\":\"richa.com\"\n}"
    
    headers = {
        'content-type': "application/json",
        'x-server-api-key': "nudY4CGIGh3rgDyB8iMqwert",
        'cache-control': "no-cache"
        }
    
    conn.request("POST", "/api/v1/sendingdomain/verify", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "http://mail.ariticmail.com/api/v1/sendingdomain/verify",
      "method": "POST",
      "headers": {
        "content-type": "application/json",
        "x-server-api-key": "nudY4CGIGh3rgDyB8iMqwert",
        "cache-control": "no-cache"
      },
      "processData": false,
      "data": "{\n\t\"domain\":\"richa.com\"\n}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "domain":"richa.com"
    }
    
    {
        "status": "success",
        "time": 0.23,
        "flags": {},
        "data": {
            "message": "done",
            "spf_status": "OK",
            "dkim_status": "OK",
            "mx_status": "OK",
            "return_path_status": "OK"
        }
    }
    

    You can verify the domain using the following code on the right panel.You will find response of the code under the Json Response tab.

    Request URL

    http://mail.ariticmail.com/api/v1/sendingdomain/verify

    Request Headers

    Header Value
    Accept application/json
    Content-Type application/json
    x-server-api-key Please use KEY value under credentials

    Verify Domain Request

    Field Name Field Type Field Value
    domain String Name of the domain to be created

    Verify Domain Response

    Field Name Field Type Field Value
    status String Status of creation of domain
    time String Time taken to return response
    flags Array Gives the list of flags if any
    message String
    spf_status String Possible status : OK/Missing/Invalid
    dkim_status String Shows te DKIM status
    mx_status String Shows thw Mail Server