Docsmit.com

Send PDFs as USPS mail (Certified, Priority and First Class) as easy as email.

Base URI

http://secure.docsmit.com/api/v1
Overview
Getting Started

The Docsmit REST API lets you send USPS mail using a variety of service levels (e.g. First Class, Certified or Priority) as well as getting data, including Docsmit’s Certification, about that mail. The API accepts JSON in requests and returns it in responses. The documents to be mailed are received in PDF. They are expected to be US Letter size (8.5x11).

We have SDKs for PHP and C#. The SDKs provide a layer of abstraction that handles authentication, encoding/decoding, token refreshing and error catching. SDKs for other languages are easily composed. If you have a particular need, please let us know. You can download the PHP SDK at https://secure.tracksmit.com/downloads/DocsmitAPI.php.txt and demo code that shows how to send mail is at https://secure.tracksmit.com/downloads/demo.php.txt.

Requirements

Before you can access the Docsmit API you must:

Production Endpoint: https://secure.docsmit.com/api/v1

Examples in this documentation show the API in practice.

Testing/Demo

We have a testing server (www.tracksmit.com) that you can point your code to, in order to run tests without incurring the expense of sending mail. If you would like to use it, you will need to sign up separately from Docsmit because it is entirely separate from the production server. Once you sign up on Tracksmit, please email [email protected] and ask for credits (like a real account balance).

Tracksmit simulates delivery of mail, including all notices and callbacks. Rather than taking days, the emulation happens on an accelerated schedule - mail becomes Mailed after no more than 15 minutes. For mail service levels with delivery tracking (e.g. Certified and Priority), that is simulated too, including the delivery of a return receipt (for Return Receipt Electronic).

Testing endpoint: https://secure.tracksmit.com/api/v1

How To Use It

All calls should have in their headers ‘Content-Type: application/json’.

To use the API, the first thing you’ll need to do is to auth to get a token. Use Get Token. You will use a token with all of the API calls (except getting a token, of course). See Auth: Tokens, Passwords and SoftwareIDs.

Creating and Sending

Once you have a token, to create a message (a mailing which goes to one or more recipients) you’ll use 3 steps.

  1. /messages/new Use this to upload your list of recipients in physicalParties and create the new message. Retain the MessageID that it returns.
  2. /messages/{messageID}/upload Use this to upload your PDF to your messaged.
  3. /messages/{messageID}/send Use this to send your message.

Tracking your mail

You can quickly get the status of all your mail in one call with /messages/sent. You don’t need to iterate over your database of mail sent and make many calls one by one, although you can call for the status of specific messages.

API Details
Auth: Tokens, Passwords and SoftwareIDs

Tokens

To use the Docsmit API, at the beginning of the session you must obtain a 16 byte temporary access token, which is required for almost all of the API calls. This token is unique to the SoftwareID and the user whose account the Software asks to work with.

The token is obtained by calling POST /token with the username (i.e. email), password and the software ID of the software that is making the request. A user can have more than one token outstanding at a time, so that more than software can be running at the same time. A user using two instances of a software with the same SoftwareID at the same time could cause failure.

To use the token, include it in your API call as the username in an HTTP Basic Authentication header (aka Token Over Basic Authentication or TOBA). The username (i.e token) followed by a colon “:” is encoded in base 64 to create an encoded token. Include the encoded token in a header in your HTTP call. [The trailing colon is included because Basic Auth uses the form of username:password, but with TOBA the password is not used.] The raw form of the header is “Authorization: Basic YWRtaW46YWRtaW4=”, where the “YWRtaW46YWRtaW4=” is the encoded token. In PHP using curl, since curl_setopt does the base 64 encoding for you, you could write

curl_setopt($ch, CURLOPT_USERPWD, $token);

A token has a Time To Live (TTL) of 1 hour, which is renewed each time it is used. Once the token expires, a new token must be obtained. The Docsmit API SDKs (PHP, Javascript and C# .NET) handle getting a new token in the event an API request fails due to an expired token (i.e. a 401 HTTP response code).

After your code has finished running you can delete the token with DELETE /token or allow the TTL to expire naturally.

Passwords

A password is established when a user obtains an account. The API expects you to hash your cleartext password using SHA-512 and then encoding it to a hex string before submitting it. This enables your code to not store your password in cleartext and ensures we do not have your password as cleartext. See /token Get Token for an example. SHA-512 hashes are readily available in all major languages. You will not ever have to submit your cleartext password to the API.

SoftwareIDs

Your SoftwareID is your private number that identifies your software and you should not release it to others. Doing so could allow others to pretend to be your software. Authenticating through a SoftwareID enables users to limit the softwares that can access their accounts and enables Docsmit to track helpful metrics. You can obtain a Software ID at no cost by submitting a request to [email protected]. Just let us know a litle about the software, how it will use Docsmit and contact information.

MessageID, UserID, and PartyID

In Docsmit a Message is a PDF document being sent to one or more recipients by USPS mail. A unique integer MessageID refers to a particular message. A MessageID is generated for each new draft message on Docsmit (e.g. using /messages/new or clicking Compose on the Docsmit website).

A PartyID is different than a UserID. A PartyID is a record about one Party to a Message (either a sender or a recipient). It points to both a Message and either a User or a MailAddress. It also holds information about the transport method being used to deliver to that party (certified mail, etc). Note that senders are also included as Parties and are indicated with isSender == true.

ClientMessageID

An API consumer has the option of providing its own message identifier (a ClientMsgID) to Docsmit when it is creating a message. Docsmit will store the ClientMsgID and the consumer has the ability retrive by a specific ClientMsgID or to use regular expressions to retrieve more than one message. The ClientMsgID is not limited to numeric (or alphanumeric), though use of special characters is discouraged because it may complicate your regex for searching.

This is useful where a consumer chooses to not store the Docsmit Message ID or has a semantic ID organizational scheme (like in the example below), which would makes the ability to match by regex valuable. When retrieving messages with /sent (or /drafts), the consumer can seek an exact match with clientMsgID or can use regex with clientMsfID_MR. The “MR” is a reminder that Docsmit uses the mysql form of regex.

For example, let’s picture an HR software consumer could send messages that relate to a Matter, Employee number and correspondence number. The ClientMsgID for the first message to an employee for a particular matter could be: 001043-001368-001. Note that the placement of the hyphens facilitates the use of regex.

Some examples:

  • ^001043- All messages relating to matter 1043
  • ^a{0,}-001368 All messages relating to employee 1368
Physical Mail (Print and Mail) Parameters

When sending mail, there are parameters relate to how the PDF attachment is printed and mailed (some optional). They are provided in each entry in physicalParties:

  • sendType - Required. This will indicate whether the item is sent 1st class, priority or some type of certified. Permitted values: “Priority Mail”, “Priority Mail with Signature”, “First Class”, “Certified”, “Certified, Electronic Return Receipt”, “Certified, Return Receipt”. Default value: “Certified, Electronic Return Receipt”

  • envelope - Required. This is the type of envelope used and must be compatible with the sendType and with the number of sheets of paper used to print the PDF attachment. Permitted values: “#10” (5 sheet limit), “Flat” (47 sheet limit), “Priority Letter” (50 sheet limit).

  • paperSize - Optional. This indicates the size of the paper to be printed on. Currently, this can only be “Letter”, meaning 8.5" x 11" paper. In the future, there may be the option for “Legal” which will be 8.5" x 14". [Values here map to DocumentClass in c2m] Permitted values: “Letter”. Default value: “Letter”

  • sided - Optional. This can be either 1 or 2 to indicate single sided or double sided. Permitted Values: 1, 2. Default value: 1. [Values map to c2m’s printOption]

  • plusRegular - Optional. This indicates that a copy is also to be sent out by first class mail in addition to the method specified in sendType. If sendType is “First Class”, plusRegular is ignored (because it is already going out First Class). Permitted values: 1 or 0 or true or false. Default value: 0.

Callback notices (vs email notices)

Docsmit will soon be able to notify the sender of various events - for example, when a mailpiece is mailed. This notice is currently sent by an email that provides a record of the data about the mailpiece (recipient address, how and when it was mailed, etc). The API allows a more sophisticated method of notice: a callback.

With a callback, Docsmit will also be able to give notice of certain events by an HTTP POST to a URI in your domain with a payload of data in JSON format. (e.g. If your account email is [email protected], the callback can call an endpoint in example.com) Using the machine-readable data from the POST, your system can automatically update the status of the mailpieces it has sent.

The events that you can receive by callback URI are:

  • mailed: COMING SOON - A mailpiece was mailed.
  • signedFor: COMING SOON - A mailpiece was signed for.
  • delivered: COMING SOON - A mailpiece was succesfully delivered.
  • proofAvailable: COMING SOON - A mailpiece has a proof of delivery available.

You set the endpoints that receive the POST when you create a message (/messages/new) and include the callbacks option in the JSON. Note that for security purposes the domain you specify in the callback must be the same as the domain in your email address. (If your application requires something else, please contact us at [email protected].) The messageID will be substituted for {messageID}, if present, in the callback URI. For example:

The following data about the event is expected to be delivered to your endpoint in JSON:

  • signedFor: email, dateTime, messageID, event, clientMsgID
  • delivered: email, dateTime, messageID, event, clientMsgID
  • mailed: email, dateTime, messageID, “mailed”, USPSTrackingID (empty if none)
  • proofAvailable: email, dateTime, messageID, “mailed”,
  • bounced: email, dateTime, messageID, event, reason, clientMsgID
  • complained: email, dateTime, messageID, event, reason, clientMsgID
  • flagged: email, dateTime, messageID, event, reason, clientMsgID
  • reminderSent: email, dateTime, messageID, event, next dateTime a reminder can be sent, clientMsgID
  • unclaimed: email, dateTime, messageID, event, next dateTime a reminder can be sent, clientMsgID

Your callback should reply with an HTTP response status code of 200 or 201 if the POST is acceptable. If Docsmit receives a 400+ response status code or no reply at all, you will receive an email advising you of the failed callback.

Docsmit provides the following URI’s for you to test your callbacks. The testing URI’s will reply back with the same body contents that are given to them.

See the examples for usage.

Misc Notes

Docsmit API resources communicate using URLs and JSON over HTTPS, unless otherwise specified. For example, GET /messages/{msgID}/documentation returns a PDF file.

All times should be specified in UTC/GMT. Any time zone adjustments should be done by the consumer.

PHP SDK

The PHP SDK facilitates synchronous calling of the API and is contained in class DocsmitAPI. You can download the PHP SDK at https://secure.tracksmit.com/downloads/DocsmitAPI.php.txt and demo code that shows how to send mail is at https://secure.tracksmit.com/downloads/demo.php.txt.

When you create an instance of the SDK class, you provide the user’s email address and password as well as the softwareID of the software making the call as authentication data to obtain a temporary access token from the API.

$docsmitAPI = new DocsmitAPI ($email, $hexHashedPassword, $softwareID[, $URIBase])

After instantiation you can confirm the authentication was successful by checking the token with if ($docsmitAPI->tokenWasOK()). The SDK class retains the token and passes it to the API with each API call. When calling the API, if the class finds the token has expired, it will refresh the token and then retry the API call.

Note that for security purposes, you do not deliver the password to even the SDK class as cleartext. When instantiating the class, you deliver the password, after it has been hashed with sha512 and converted to (lowercase) hex. The SDK provides a static helper function to perform the hashing and encoding:

$hexHashedPassword = DocsmitAPI::hexHashPW("myCleartextPassword");

Optional parameter URIBase is used in the rare circumstance you need to use a different API version than the default (currently “https://secure.docsmit.com/api/v1/”).

HTTP calls

Class methods that call the API are named for the verbs used in the call. $url is the part of the URI that follows the URIBase, such as /messages/inbox). $params is an associative array (such as array("signed" => true)) of the parameters to go the API. All methods except get() convert $params to JSON and send it in the HTTP body. get() converts it to a URI query (like /messages/inbox?signed=true).

  • get($url, $params)
  • post($url, $params)
  • delete($url, $params)
  • put($url, $params)

Uploading Files

There are two methods for uploading files using DocsmitAPI SDK, however they both use the same API resource /upload.

Using file path - postFile($uri, $params)

postFile() is used to upload a single file that is stored in the file system. The file is specified by including the file path as filePath in $params.

Example:

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$params["filePath"] = "D:\images\mcc-profuction-acc(55c3308aa2708).PDF";
$docsmit->postFile('/messages/1420/upload', $params);
  • Upload file(s) using blob - postBlob($URI, $params)

postBlob() is used to upload one or more files that are stored variables, rather than the local filesystem. This is useful where the file to be uploaded is the result of a process, rather than something that will be kept. For example, if the file to be uploaded is an encrypted version of a local file, the local file can be transformed in memory (in a variable) and then uploaded without ever saving the file. Or since FPDF or TCPDF can generate PDF files to a variable, you can similarly upload from a variable without ever saving the file to the filesystem.

It has second parameter which is $params. it also required $params['files'] associative array having filename,type and content parameter with valid filename,type and content and $params["fields"]. Below is the example.

Example:

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
    $params["files"] = array();

    $filePath1 = "D:\images\mcc-profuction-acc(55c3308aa2708).PDF";
    $filename1 = basename($filePath1);
    $finfo1 = new finfo(FILEINFO_MIME);
    $mimeType1 = $finfo1->file($filePath1);
    $fileBlob1 = file_get_contents($filePath1, true);
    $file1 = array(
        "filename1" => $filename1,
        "type2" => $mimeType1,
        "content3" => $fileBlob1
    );

    $filePath2 = "D:\images\Koala(5534d88f3443c).pdf";
    $filename2 = basename($filePath2);
    $finfo2 = new finfo(FILEINFO_MIME);
    $mimeType2 = $finfo2->file($filePath2);
    $fileBlob2 = file_get_contents($filePath2, true);
    $file2 = array(
        "filename" => $filename2,
        "type" => $mimeType2,
        "content" => $fileBlob2
    );

   array_push($params["files"], $file1, $file2);

   $docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
   $docsmit->postBlob('/messages/1420/upload2', $params);

Handling Responses

Checking the HTTP response status code of the most recent call on the API is supported by methods:

  • tokenWasOK() - true if the most recent attempt to use the token was accepted. If the SDK class had to refresh the token, this will be reflective of the refreshed token.
  • status() - gives the HTTP return status code. e.g. 200, 201, 400, 401, 403
  • returnedError() - true if status >= 400
  • returnedSuccess() - true if status is 200 or 201

The body of the response is accessed by method:

  • responseJSON() - gives an object representing the JSON reply

The example pages also show the PHP SDK in use.

Ex 1 - Authentication, check sent messages, read a message

This example uses the PHP SDK to authenticate, obtain a list of sent messages and obtain detailed data about the first message.

<?php

require_once 'DocsmitAPI.php';

function errorCheck ($docsmit) {
    if ($docsmit->returnedError()) {
        if ($docsmit->status() == 401)
            echo "401 Authentication Failed - Check auth data<BR>";
        if ($docsmit->status() == 400)
            echo "400 Bad Request<BR>";
        if ($docsmit->status() == 403)
            echo "403 Forbidden - Authenticated, but no permissions for that request<BR>";
        return true;
    }
    return false;
}

$email = ''; //The user's email address, e.g. [email protected]
$password = ''; //Your password here, e.g. RainbowUnicorn
$softwareID = ''; //Your software ID here, e.g. cdca82178a52505ab5232e97b5a39b39

$hexHashedPW = DocsmitAPI::hexHashPW($password);
$docsmit = new DocsmitAPI($email, $hexHashedPW, $softwareID);

echo "<h1>Sent Messages for " . $email . "</h1><BR><BR>";

$docsmit->get('/messages/sent');
if (errorCheck($docsmit))
    die("ITRW, add error resolution here");
$response = $docsmit->responseJSON();
foreach ($response as $message) {
    echo $message->id . " ";
    if ($message->certified)
        echo "CERTIFIED ";
    echo $message->title . "<BR>";
}
echo "<BR>";

$firstID = $response[0]->id;
echo "<H3>First message's details [messageID = $firstID]</H3>";
$docsmit->get('/messages/' . $firstID);
if (errorCheck($docsmit))
    die("ITRW, add error resolution here");
$response = $docsmit->responseJSON();
echo "decoded = <PRE>".json_encode($response, JSON_PRETTY_PRINT)."</pre><BR>";

?>

To invoke error catching, try altering any of the authentication data to be wrong or change $firstID to be a wrong number, like 7.

Ex 2 - Send Mail Merge with callback notice

Sending messages is fairly simple. In the PHP SDK, the consumer places the relevant parameters into an array, creates the new message, then sends it To execute a mail merge we loop over information retrieved from a database, sending a message during each iteration. For the sake of this example, we assume that the results have been received in associative array $dbResults, though you can iterate over any data source. We set a callback notice endpoint for each email and also show a sample script for that endpoint.

Sample script for Mail Merge

$docsmit = new DocsmitAPI($email, Docsmit::hexhashedPW($clearPW), $softwareID);
$params = arrray ();
foreach ($dbResults as $dbResult) {
    $params ["subject"] = $dbResult["premises"];
    $params["to"] = $dbResult ["to"];
    $params["body"] = "<p>This is to notify you that your lease of " . $dbResult["premises"]
        . " will terminate on " . $dbResult["endDate"] . ". Thank you for your business.";
    $messageID = $docsmit->post("/new", $params);
    /* error checking: confirm the message was constructed successfully */
    $docsmit->post("/send/".$messageID);
    /* error checking: confirm the message was sent successfully */
}

Sample script for signedFor callback endpoint

SignatureLog is a made-up class that writes data to a made-up database that keeps track of signatures. In this example we give it the event ("signedFor"), the Docsmit MessageID, the date and time of the signature, and the email address of the person that signed.

<?php
$payloadJSON = file_get_contents('php://input');
$payload= json_decode( $payloadJSON, TRUE ); //convert JSON into array
$signatureLog = new SignatureLog ();
$signatureLog->record ($payload->event, $payload->messageID, $payload->dateTime, $payload->email);

Of course, in the alternative, SignatureLog could have taken a ClientMsgID instead of a messageID (Docsmit’s message ID).

Ex 3 - Blast messages, clientMsgIDs and message status check

Email a bunch of people with an email blast and get notified by HTTP when each person signs. Each person gets a clientMsgID.

__Sample script for the Blast messages

$email = ''; //The user's email address, e.g. [email protected]
$password = ''; //Your password here, e.g. RainbowUnicorn
$softwareID = ''; //Your software ID here, e.g. cdca82178a52505ab5232e97b5a39b39

$hexHashedPW = DocsmitAPI::hexHashPW($password);

$docsmit = new DocsmitAPI($email, Docsmit::hexhashedPW($clearPW), $softwareID);
$body = array(
    "title" => "This is new message for the Blast Message",
    "bodyText" => "This is new message for the Blast Message",
    "toList" => array(
        array(
            "email" => "[email protected]",
            "isSender" => "1"
        ),
        array(
            "email" => "[email protected]"
        ),
        array(
            "email" => "[email protected]"
        ),
    ),
    "blastMessage" => true,
    "signatureRequired" => true
);
$docsmit->post('/messages/new', $body);
/* error checking: confirm the message was constructed successfully */

$docsmit->post("/send/".$messageID);
/* error checking: confirm the message was sent successfully */

After the messages have been sent, we can periodically check the status of the message’s recipients’ signatures. This could be done, for example, as a cron job.

API Methods
Authentication Tokens

Handles temporary access tokens.

POST /token
DELETE /token
Get Token
POST /token

This endpoint allows the user to obtain a token by authenticating with username (i.e. email address), password and SoftwareID to obtain a token. See notes below and Auth: Tokens, Passwords and SoftwareIDs about not sending the password as cleartext. Tokens currently expire 1 hour after issuance.

The token is then presented to the API in all subsequent calls as the username in HTTP Basic Authentication (Token Over Basic Authentication).

Once the token expires (e.g. a 401 HTTP response code is received to an API call), a new token should be obtained. A user that uses two instances of software with the same SoftwareID could have difficulties.

This is the only API resource that does not require a token to be presented.

Notes

Do not send the password by cleartext. First apply a SHA-512 hash to the cleartext password, then encode it as a hex string (case does not matter) and send only that hashed result.
For example, in PHP:

$email = '[email protected]';
$password = 'cleartext';
$softwareID = ''; // Enter softwareID here
$hashedPW = hash('sha512', $password)
$uri = 'https://secure.docsmit.com/api/v1/token'; // or use tracksmit.com for testing
$curl = curl_init($uri);
$curl_post_data = array(
    'email' => $email,
    'password' => $hashedPW,
    'softwareID' => $softwareID
);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data);
$curl_response = curl_exec($curl);
if ($curl_response === false) {
    $info = curl_getinfo($curl);
    curl_close($curl);
    die('error occured during curl exec. Additional info: ' . var_export($info));
}
curl_close($curl);
$decoded = json_decode($curl_response);
if (isset($decoded->response->status) && $decoded->response->status == 'ERROR') {
    die('error occured: ' . $decoded->response->errormessage);
}
echo 'response ok! Token = ' . print_r ($decoded->token, true);

Request body

application/x-www-form-urlencoded

Example:

POST /token {
"email" : "[email protected]",
"password" : "0ce71cec25e7e01fc96cb6a43c7a5428a27991dcc311ce5544b45589a956d820b70d6d84a2d9b37cbce39d193fe3e3973c69c6f67bf99613e87f400cbde23826",
"softwareID" : "1d1337900b318d011bf64aee747b442d"
}
Object
SoftwareID
string

16 bytes in base16 (0-F). This indicates which software is attempting to access the API. Only softwares which are granted permission by the user will be able to access the API.

password
string

user’s password, hashed with sha512 and encoded as a hex string. DO NOT send password by cleartext.

email
string

email address of the user

Responses

201 Created
Body
Object
token
string
Example:
e6e89065213c63adda64c43ca22dc2e0
userID
string
Example:
681
name
string
Example:
masaledara
email
string
company
string
Example:
test company2
address1
string
Example:
3103 N 10th Street
address2
string
Example:
Suite 201
city
string
Example:
Arlington
state
string
Example:
VA
zip
string
Example:
22210
suspended
integer
timezone
string
Example:
America/New_York
timezoneAsNumber
string
Example:
UTC/GMT -04:00
attachmentFilesMaxLimit
integer
Example:
314572800
bullpenFilesMaxLimit
integer
Example:
104857600
creditBalance
string
Example:
9011.93
Delete Token
DELETE /token

Deletes the token, revoking its ability to authenticate.

Request body

Object
softwareID
string

16 bytes in base16 (0-F). This indicates which software is attempting to access the API. (See POST /token)

Responses

200 OK

Either “Token deleted.” or “Token not found.”

400 Failed

Needs SoftwareID

Messages - Before Sending
POST /messages/new
POST /messages/{messageID}/upload
POST /messages/{messageID}/send
POST /messages/{messageID}/party
DELETE /messages/{messageID}/party/{partyID}
PUT /messages/{messageID}/party/{partyID}
GET /messages/{messageID}/priceCheck
New Message
POST /messages/new

Create a new message. All of the request fields are optional, except title.

Request body

If the return address parameters (rtn*) are not specified or are blank, when the message is sent Docsmit will attempt to use the user’s address as the return address.

Object
title
string

This is not shown to the recipient and can only be viewed by the sender.

physicalParties

physicalParties is an array of MailAddressCreator, that is a list of mail recipients and how they are being sent the mail.

rtnName
string

Return address name.

Example:
"John Paul"
rtnOrganization
string

Return address organization.

Example:
"abc & co."
rtnAddress1
string

Return address address1

Example:
"The Audobon Buidling"
rtnAddress2
string

Return address address2

Example:
"135 Bergen Ave, Suite 101"
rtnCity
string

Return address city

Example:
"Jersey City"
rtnState
string

Return address state

Example:
"NJ"
rtnZip
string

Return address zip. This can be either a 5 digit zip or a 9 digit zip+4.

Example:
"12345-1234"
SASE
string

(Optional: default = 0) 1 indicates that a Self Addressed Stamped Envelope will be enclosed. The postage included on the envelope will be enough for a first class #10 envelope.

deliverAfter
string

(NOT CURRENTLY BEING USED) If set, this is the approximate time (but not before) at which the message will be sent out. Note that system adjust the time based on the user’s stated time zone.

Example:
07/26/15, 04:49 AM
callbackURIs
string

Provides URIs at the sender that Docsmit will call if certain events occur, such as a message bouncing or getting signed or a message becoming flagged.

Example:
{ "bounced" : "http://mailer.sender.com/docsmitAPI/bounced/{messageID}", "flagged" : "http://mailer.sender.com/docsmitAPI/flagged/{messageID}", "unclaimed" : "http://mailer.sender.com/docsmitAPI/unclaimed/{messageID}"}
billTo
string

Alphanumeric for sender’s use in tracking billing to its clients. Setting BillTo for a message sets the BillTo for any transactions generated for that message. Grouping by BillTo code is available on Docsmit invoices. BillTo codes can be edited, even after sending.

clientMsgID
string

a client suppled clientMsgID that can later be used to lookup the message.

Example:
JOHNS-004-511

Responses

201 Created

Success. Returns messageID with new message number.

Body
Object
messageID
string

The MessageID of the new message.

400 Bad Request

Problem with one of the request parameters.

401 401

Email and password or token was not accepted.

403 Forbidden

User does not have authority to perform this action on this message.

500 Internal Server Error

Problem inserting.

Examples

Uses some options

POST http://secure.docsmit.com/api/v1/messages/new HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$body = array(
    "title" => "This is new message title from Hiren testcase",
    "bodyText" => "This is new message body from Hiren testcase",
    "toList" => array(
        array(
            "email" => "[email protected]",
            "isSender" => "1"
        ),
        array(
            "email" => "[email protected]"
        )
    ),
    "unclaimedNoticeTimeout" => "7/30/15, 03:29 AM",
    "deliverAfter" => "",
    "excludeMessageBody" => true,
    "blastMessage" => "",
    "signatureRequired" => true
);
$docsmit->post('/messages/new', $body);
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 201 Created 

Content-Type: application/json

{
    "messageID": "2097"
}

Create new message that calls testing callback URIs

POST http://secure.docsmit.com/api/v1/messages/new HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$body = array(
    "title" => "This is new message title from Hiren testcase",
    "bodyHTML" => "<h1>This html has also script tag</h1> we need strip script tag from html.",
    "toList" => array(
        array(
            "email" => "[email protected]",
            "isSender" => "1"
        ),
        array(
            "email" => "[email protected]"
        )
    ),
    "unclaimedNoticeTimeout" => "7/30/15, 03:29 AM",
    "deliverAfter" => "",
    "excludeMessageBody" => true,
    "blastMessage" => "",
    "signatureRequired" => true,
    "callbackURIs" => array(
        "delivered" => "https://robert.doxmit.com/api/v1/messages/delivered?messgeID={messageID}",
        "signedFor" => "https://robert.doxmit.com/api/v1/messages/testing/signFor/{messageID}"
    )
);
$docsmit->post('/messages/new', $body);
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 201 Created 

Content-Type: application/json

{
    "messageID": "2058"
}
POST http://secure.docsmit.com/api/v1/messages/new HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$body = array(
    "title" => "This is new message title from Hiren testcase",
    "bodyHTML" => "<h1>This html has also script tag</h1> we need strip script tag from html.",
    "physicalParties" => array(
array(
	
		"firstName"=>"John",
		"lastName"=>"backham",
		"organization"=>"abc & co.",
		"address1"=>"880 Bergen Avenue,"
		"address2"=>"Suite 204",
		"city"=>"Jersey City",
		"state"=>"NJ",
		"postalCode"=>"07306",
	),
	array(
		"firstName"=>"Dyne",
		"lastName"=>"Hyuston",
		"organization"=>"Dyne & co.",
		"address1"=>"120 Main Street",
		"city"=>"New Orleans",
		"state"=>"LA",
		"postalCode"=>"12345-1234",
	)
	
),
"rtnName"=> "John Paul",
"rtnOrganization"=> "ABC & Co",
"rtnAddress1"=> "26 Journal Square, 8th Floor"
"rtnCity"=> "Jersey City",
"rtnState"=> "NJ",
"rtnZip"=> "07306",
"unclaimedNoticeTimeout" => "7/30/15, 03:29 AM",
"deliverAfter" => "",
"excludeMessageBody" => true,
"blastMessage" => "",
"signatureRequired" => true,
"callbackURIs" => array(
    "delivered" => "https://robert.doxmit.com/api/v1/messages/delivered?messgeID={messageID}",
    "signedFor" => "https://robert.doxmit.com/api/v1/messages/testing/signFor/{messageID}"
)
);
$docsmit->post('/messages/new', $body);
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 201 Created 

Content-Type: application/json

{
    "messageID": "2035"
}
Upload a file
POST /messages/{messageID}/upload

Uploads a PDF file to be used as the content for a message. This call does not deliver data by JSON. The file is delivered by Content-Type:multipart/form-data and that should be in the headers (instead of Content-Type:application/json).

This is an example written in PHP using curl() and CurlFile to upload the file stored as $params[‘filePath’]:

    if (isset($params["filePath"]) && file_exists($params["filePath"])) {
        $ch = curl_init($URIBase . $url);
        curl_setopt($ch, CURLOPT_POST, true);
        $finfo = new finfo(FILEINFO_MIME);
        $mimeType = $finfo->file($params["filePath"]);
        $params["file"] = new CurlFile($params["filePath"], $mimeType);

        curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type:multipart/form-data"));
        curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);  //use for tracksmit.com server
        curl_setopt($ch, CURLOPT_USERPWD, $token);
        $response_body = curl_exec($ch);
    }

Path variables

messageID
string optional

Request body

multipart/form-data

Responses

200 OK

File uploaded successfully.

403 403 - Unauthorized Access

User does not have authority to perform this action on this messageID.

400 400

Problem with one of the request parameters.

Examples

PHP SDK: Upload a file using blob for message as an attachment.

POST http://secure.docsmit.com/api/v1/messages/1420/upload HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$params["files"] = array();

$filePath1 = "D:\images\mcc-profuction-acc(55c3308aa2708).PNG";
$filename1 = basename($filePath1);
$finfo1 = new finfo(FILEINFO_MIME);
$mimeType1 = $finfo1->file($filePath1);
$fileBlob1 = file_get_contents($filePath1, true);
$file1 = array(
    "filename1" => $filename1,
    "type2" => $mimeType1,
    "content3" => $fileBlob1
);

$filePath2 = "D:\images\Koala(5534d88f3443c).jpg";
$filename2 = basename($filePath2);
$finfo2 = new finfo(FILEINFO_MIME);
$mimeType2 = $finfo2->file($filePath2);
$fileBlob2 = file_get_contents($filePath2, true);
$file2 = array(
    "filename" => $filename2,
    "type" => $mimeType2,
    "content" => $fileBlob2
);

array_push($params["files"], $file1, $file2);

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$docsmit->postBlob('/messages/1420/upload', $params);
$status = $docsmit->responseBody()

HTTP/1.1 200 OK 

Content-Type: application/json

{ "fileData": [ { "fileID": 1872, "fileName": "mcc-profuction-acc(55c3308aa2708).PNG", "size": "87897", "uploadedTime": "2015-10-22 09:00:16" }, { "fileID": 1873, "fileName": "Koala(5534d88f3443c).jpg", "size": "780831", "uploadedTime": "2015-10-22 09:00:16" } ] }
POST http://secure.docsmit.com/api/v1/messages/1420/upload HTTP/1.1 

Content-Type: application/json

$filePath = "/home/robert/staging_secure/drive/docs/files/mcc-profuction-acc(55c3308aa2708).PNG";
$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID, SECUREURL . "/api/v1");
$params['filePath'] = $filePath;
$docsmit->post('/messages/1420/upload', $params, 1);
$status = $docsmit->responseBody()

HTTP/1.1 200 OK 

Content-Type: application/json

{ "fileData": [ { "fileID": 1872, "fileName": "mcc-profuction-acc(55c3308aa2708).PNG", "size": "87897", "uploadedTime": "2015-10-22 09:00:16" }, { "fileID": 1873, "fileName": "Koala(5534d88f3443c).jpg", "size": "780831", "uploadedTime": "2015-10-22 09:00:16" } ] }
Send Message
POST /messages/{messageID}/send

Sends a message that has already been created. If there are problems with the content (e.g. no recipients or no PDF) and the message cannot be sent, this resource will return 403.

Sending messages through the API can only be paid for using already purchased credit. If there is not enough credit the send will fail and return a 402 HTTP status code.

Path variables

messageID
integer required

Responses

201 Created

Message has been sent successfully.

Body
Object
MessageID
integer

Docsmit Message ID

ClientMsgID
string

The ClientMsgID of the sent message

402 Payment Required

Send failed due to inadequate funds. The amount needed is returned in the JSON as shortfall.

403 403 - Unauthorized Access

User does not have authority to perform this action on this messageID.

400 400

Problem with one of the request parameters.

Examples

Sends the message for specified messageID

POST http://secure.docsmit.com/api/v1/messages/1496/send HTTP/1.1 

HTTP/1.1 201 Created 

Content-Type: application/json

{
  messageID: 2144,
  messageID: "1496",
  clientMsgID: ""
}

HTTP/1.1 402 Payment Required 

Content-Type: application/json

{ 
    "message": "Your current credit balance is $0.00 which is insufficient to send message with API. Please buy credits to send message using API.",
    "shortfall": 1.12
    
}
Add Party
POST /messages/{messageID}/party

This API call allows you to add one or more recipients by providing them in the physicalParties data type.

Path variables

messageID
string required

Request body

Object
physicalParties

physicalParties is an array of MailAddresses, that is a list of mail recipients and how they are being sent the mail.

Responses

201 Created

The party has been added.

Body
Object
PartyID
string
400 400

Problem with one of the request parameters.

401 401

Email and password or token was not accepted.

403 403 - Unauthorized Access

User does not have authority to perform this action on this messageID.

404 Not Found

MessageID or PartyID not found.

Examples

Comma deliminated userIDs to be added as message parties.

POST http://secure.docsmit.com/api/v1/messages/1200/party HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$params = array("userIDs" => "472,473,474");
$docsmit->post("/messages/1200/party", $params);
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 201 Created 

Content-Type: application/json

[
    {
        "partyID": 5032,
        "userID": "472",
        "name": null,
        "company": null,
    },
    {
        "partyID": 5033,
        "userID": "473",
        "name": null,
        "company": null,
    },
    {
        "partyID": 5034,
        "userID": "474",
        "name": null,
        "company": null,
    }
]

email address to be added as message party.

POST http://secure.docsmit.com/api/v1/messages/1200/party HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$params = array("email" => "[email protected]");
$docsmit->post("/messages/1200/party", $params);
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 201 Created 

Content-Type: application/json

[
    {
        "partyID": 5015,
        "userID": 467,
        "name": null,
        "company": null
    }
]
POST http://secure.docsmit.com/api/v1/messages/2333/party HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$params = array("recipients" => "[email protected],[email protected],[email protected],[email protected]");
$docsmit->post("/messages/2333/party", $params);
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 201 Created 

Content-Type: application/json

[
    {
        "partyID": 5021,
        "userID": 472,
        "name": null,
        "company": null
    },
    {
        "partyID": 5022,
        "userID": 473,
        "name": null,
        "company": null
    },
    {
        "partyID": 5023,
        "userID": 474,
        "name": null,
        "company": null
    },
    {
        "partyID": 5024,
        "userID": 475,
        "name": null,
        "company": null
    }
]

List of email address to be added as message parties. email and isSender will be added as parameter of list.

POST http://secure.docsmit.com/api/v1/messages/2333/party HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$params = array("toList" => array( array("email"=>"[email protected]"),array("email"=>"[email protected]"),array("email"=>"[email protected]"),array("email"=>"[email protected]")));
$docsmit->post("/messages/2333/party", $params);
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 201 Created 

Content-Type: application/json

[
    {
        "partyID": 5025,
        "userID": 476,
        "name": null,
        "company": null
    },
    {
        "partyID": 5026,
        "userID": 477,
        "name": null,
        "company": null
    },
    {
        "partyID": 5027,
        "userID": 478,
        "name": null,
        "company": null
    },
    {
        "partyID": 5028,
        "userID": 479,
        "name": null,
        "company": null
    }
]

List of physical parties to be added as mail parties of message.

POST http://secure.docsmit.com/api/v1/messages/2331/party HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$params = array("physicalParties" => array(
                    array("firstName" => "John",
				"lastName" => "Adams",
				"organization" => "Masaledara Consulting",
				"address1" => "1 Pioneer Way",
				"city" => "Las Vegas",
				"state" => "NV",
				"postalCode" => "12345-1234",
				"envelope" => "#10 Double Window"
				),
                    array("firstName" => "Stan",
				"lastName" => "Sitwell",
				"organization" => "Sitwell & Sitwell, LLP",
				"address1" => "1250 Avenue of the Americas",
				"address2" => "Floor 22",
				"city" => "New York",
				"state" => "NY",
				"postalCode" => "10021",
				"envelope" => "#10 Double Window",
				"SASESheets"=>5,
				),
                    array("firstName" => "Herbert",
				"lastName" => "Hoover",
				"organization" => "Seven Presidents Consulting",
				"address1" => "1141 Ocean Ave",
				"city" => "Long Branch",
				"state" => "NJ",
				"postalCode" => "07064",
				"envelope" => "#10 Double Window",
				"SASESheets"=>3,
				),
                    );
$docsmit->post("/messages/2331/party", $params);
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 201 Created 

Content-Type: application/json

[
    {
        "partyID": 5035,
        "mailAddressID": 96,
        "name": "masaledara consulting",
        "company": "masaledara consulting"
    },
    {
        "partyID": 5036,
        "mailAddressID": 97,
        "name": "masaledara22222 consulting22222222222222222",
        "company": "masaledara consulting22"
    },
    {
        "partyID": 5037,
        "mailAddressID": 98,
        "name": "masaledara23333 consulting33",
        "company": "masaledara consulting33"
    }
]
Delete Party
DELETE /messages/{messageID}/party/{partyID}

Removes a party from a message. Can only be performed on messages that have not been sent yet and cannot be performed on the message owner.

Path variables

messageID
string required
Example:
1455
partyID
string required
Example:
6534

Responses

200 OK
Body
Object
partyID
number
Example:
4370
success
boolean
Example:
true

Examples

DELETE http://secure.docsmit.com/api/v1/messages/1455/party/6534 HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$docsmit->delete("/messages/1455/party/6534", $params);
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "partyID": 6534,
    "success": true
}
Update Party
PUT /messages/{messageID}/party/{partyID}

Updates one or more of the following fields in a party: firstName, lastName, organization, address1, address2, address3, city, state, postalCode, countryNonUS

Path variables

messageID
string required
Example:
1234
partyID
string required

Request parameters

firstName
string optional

Updates firstName field.

Example:
Michael
lastName
string optional

Updates lastNamefield.

Example:
Johnson
organization
string optional

Updates organization field.

Example:
Johnson On the Spot, Inc.
address1
string optional

Updates address1 field.

Example:
135 Bergen Ave
address2
string optional

Updates address2 field.

Example:
Suite 101
city
string optional

Updates city field.

Example:
Jersey City
state
string optional

Updates state field.

Example:
NJ
postalCode
string optional

Updates postalCode field

Example:
07305
countryNonUS
string optional

(DON’T USE - we only send within the US) Updates countryNonUS field

SASESheets
integer optional

10

Responses

202 Accepted

Examples

Updates mail party address

PUT http://secure.docsmit.com/api/v1/messages/2275/party/4760 HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$body = array("firstName" => "Albert",
"lastName" =>"Einstein",
"organization" =>"masaledara consulting4",
"address1" =>"this is adres 18",
"city" =>"vegas5",
"state" =>"la",
"postalCode" =>"12345-1234",
"endorsement" =>"i am hiren",
"SASESheets"=>5
);
$docsmit->put('/messages/2275/party/4760', $body);

HTTP/1.1 202 Accepted 
Get the price and the details
GET /messages/{messageID}/priceCheck

Path variables

messageID
integer required

Request parameters

certify
boolean required
months
integer required

Set Months for 1,3 & 7 Year

Enumeration:
12
36
84
sendType
string required
Enumeration:
SR
NSR

Responses

200 OK

Returns information about netPrice and detail.

Body
Object
netPrice
number
details
Object
total_base
string
Example:
$ 2.49
total_mb
string
Example:
0.00
total
string
Example:
$ 2.49
actualMB
string
Example:
0 MB
chargedMB
string
Example:
0 MB
discountMB
string
Example:
0 MB
certification
string
Example:
Pre-Certification
cert_base
string
Example:
$ 1.99
certMB
string
Example:
0.00
extension
string
Example:
Extend 12 months
ext_base
string
Example:
$ 0.50
extMB
string
Example:
0.00
expiration_after
string
Example:
8/28/17
discount
string
Example:
$ (2.49)
netPrice
string
Example:
$ 0.00
400 Bad Request

Invalid MessageID,certify,months,sendType parameters.

401 401

Email and password or token was not accepted.

Examples

GET http://secure.docsmit.com/api/v1/messages/1234/priceCheck?certify=false&months=12&sendType=SR HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID,"http://secure.docsmit.com/api/v1");
$params = array("certify" => 1, "months" => 12, "sendType" => "SR");
$docsmit->get("/messages/1234/priceCheck", $params);
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "netPrice": 1,
    "details": {
        "total_base": "$ 2.49",
        "total_mb": "0.00",
        "total": "$ 2.49",
        "actualMB": "0 MB",
        "chargedMB": "0 MB",
        "discountMB": "0 MB",
        "certification": "Pre-Certification",
        "cert_base": "$ 1.99",
        "certMB": "0.00",
        "extension": "Extend 12 months",
        "ext_base": "$ 0.50",
        "extMB": "0.00",
        "expiration_after": "8/28/17",
        "discount": "$ (2.49)",
        "netPrice": "$ 0.00"
    }
}
Messages - After Sending

Resources for getting data about a message or setting some data after it was sent.

GET /messages/{messageID}
GET /messages/{messageID}/documentation
GET /messages/{messageId}/parties
GET /messages/{messageID}/attachments
GET /messages/{messageID}/transactions
GET /messages/{messageId}/download/{fileId}
GET /messages/{messageID}/download/{ZipID}
Get a message
GET /messages/{messageID}

Returns information about the message including recipients, its contents (or pointers to contents for some parts) and its status.

Path variables

messageID
integer required

Responses

200 OK

Returns message body, title, list of attachments, recipients (with statuses), sent Status/time

Body
Object
id
integer

MessageID

from
string

The sender of the Message

title
string

Message Title

Example:
Test Message :: 2879
to
Object
email
string

Recipient Email

unread
boolean

If true then message is unread by the Recipient.

Example:
true
SignedFor
string

The Message signedFor Date.

Example:
2015-09-18 06:33:31
attachments
boolean

If true, Message has atatchments.

Example:
true
threadRoot
integer
certified
boolean

If true, Message is certified.

Example:
true
attSize
integer

Message Attachment size.

sent
string date
Example:
2015-09-18 05:49:02
transaction
string

Message Transaction status with p,c,f,a

Enumeration:
aborted : a
Example:
Paypal Completed : c
bookmarked
boolean

If true, Message is bookmarked.

Example:
true
isFlagged
boolean

If true then,Message is Flagged

Example:
true
isDeliverAfter
boolean

If true, Message is set as DeliverAfter

Example:
true
isSent
boolean

If true, Message is sent.

isBlastMessage
boolean

If true, recipients can’t see other recipients information.

Example:
true
totalRecipientsCount
integer

Total Recipients of the Message.

totalUnsignedCount
integer

Total Unsigned Message count.

isEncrypted
boolean

If True, Message is encrypted.

alreadySentType
string

Returns Message Last Sent Type

Example:
SR
SRSent
string date

If Message sent as SR then returns SR sent DateTime

Example:
2015-09-18 05:49:02
NSRSent
string date

If Message sent as NSR then returns NSR sent DateTime

Example:
0000-00-00 00:00:00
SRDeliverAfter
string

DateTime of SRDeliverAfter.

Example:
0000-00-00 00:00:00
NSRDeliverAfter
string date

DateTime of NSRDeliverAfter.

Default:
0000-00-00 00:00:00
taglist
string

Messages Tag List

Example:
tag1,tag2
AsOf
string date

Current Time in UTC.

Example:
2015-09-23 05:16:20
isBounced
boolean

If true, Message is bounced.

Example:
true
bouncedMsgCount
Object
total
integer

Total Bounced parties count.

initialBounce
integer

Total initialbounced parties count.

reminderBounce
integer

Total Reminder Bounced parties count.

parties
Object
id
integer

Party ID

Example:
11438
userID
integer

Party UserId for the Message.

Example:
321
email
string

Party email Address

name
string

Name of the Party.

Example:
shcnarola
company
string

Company Name of the company.

isSender
boolean

If true, party is sender otherwise user is message Recipients.

Example:
true
isOwner
boolean

If true, Party is owner of the Message.

Example:
true
canEdit
boolean

If true, Party can edit the Message.

Example:
true
unclaimedNoticeTimeout
string date

Message Timeout DateTime.

views
Object
totalViews
integer

Total count of the Message view.

firstView
string date

Message Firstview DateTime.

Example:
2015-01-01 13:00:00
lastView
string date

Message LastView DateTime

Example:
2015-01-01 13:00:00
isSignedFor
boolean

If true, Message is SignedFor

Example:
true
signedFor
string date

DateTime of the Message signedFor.

Example:
2015-01-01 13:00:00
reminders
string

Message Reminder dates.

Example:
2015-09-18 07:50:29
DELsmtpResponse
string

SMTP Response of the message delivery.

DELtimestamp
string

Timestamp of the Message delivery.

DLs
string

If message has Zip then returns Total Zip download count.

addedAfter
boolean

Party is added After Message sent.

addedBy
string

The emailaddress of the party addedBy

sent
string date

Date of the MessageSent.

Example:
2015-09-18 05:49:02
bounced
boolean

If true, Message is bounced.

isInitialBounce
boolean

If true, Party is initial bounced.

isReminderBounce
boolean

If true, Party is Reminder bounced.

bounceTimestamp
string date

The dateTime of the Bounced Timestamp.

bounceDiagnosticCode
string

The Diagnostic code for the bounced message.

bounceAction
string

Action for the Bounced message.

canRemind
boolean

if true, Party can remind.

nextRemind
string date

The dateTime of the Next Reminder.

403 403 - Unauthorized Access

User does not have authority to perform this action on this messageID.

400 400

Problem with one of the request parameters.

204 204

Content not found.

401 401

Email and password or token was not accepted.

Examples

Get a message details by specified messageID

GET http://secure.docsmit.com/api/v1/messages/2879 HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$docsmit->get('/messages/2879');
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "messageID": 2879,
    "from": "[email protected]",
    "title": "Test Message :: 2879",
    "to": [
        {
            "email": "[email protected]",
            "unread": 0,
            "SignedFor": "2015-09-18 06:33:31"
        },
        {
            "email": "[email protected]",
            "unread": 1,
            "SignedFor": ""
        }
    ],
    "attachments": 0,
    "threadRoot": 2879,
    "certified": 1,
    "attSize": 0,
    "sent": "2015-09-18 05:49:02",
    "transaction": "c",
    "bookmarked": 0,
    "isFlagged": 0,
    "isDeliverAfter": 0,
    "isSent": 1,
    "isBlastMessage": 0,
    "totalRecipientsCount": 2,
    "totalUnsignedCount": 1,
    "isEncrypted": 0,
    "alreadySentType": "SR",
    "SRSent": "2015-09-18 05:49:02",
    "NSRSent": "0000-00-00 00:00:00",
    "SRDeliverAfter": "0000-00-00 00:00:00",
    "NSRDeliverAfter": "0000-00-00 00:00:00",
    "taglist": "tag1,tag2",
    "AsOf": "2015-09-23 05:16:20",
    "isBounced": false,
    "bouncedMsgCount": {
        "total": 0,
        "initialBounce": 0,
        "reminderBounce": 0
    },
    "parties": [
        {
            "partyID": 11438,
            "userID": 321,
            "email": "[email protected]",
            "name": "shcnarola",
            "company": "",
            "isSender": 1,
            "isOwner": 1,
            "canEdit": 1,
            "unclaimedNoticeTimeout": "",
            "views": {
                "totalViews": 0,
                "firstView": "",
                "lastView": ""
            },
            "isSignedFor": 0,
            "signedFor": "",
            "reminders": null,
            "DELsmtpResponse": null,
            "DELtimestamp": "",
            "DLs": "",
            "addedAfter": 0,
            "addedBy": "[email protected]",
            "sent": "2015-09-18 05:49:02",
            "bounced": 0,
            "isInitialBounce": 0,
            "isReminderBounce": 0,
            "bounceTimestamp": "",
            "bounceDiagnosticCode": "",
            "bounceAction": "",
            "canRemind": 0,
            "nextRemind": ""
        },
        {
            "partyID": 11439,
            "userID": 339,
            "email": "[email protected]",
            "name": "Narola",
            "company": "",
            "isSender": 0,
            "isOwner": 0,
            "canEdit": 0,
            "unclaimedNoticeTimeout": "",
            "views": {
                "totalViews": 6,
                "firstView": "2015-09-18 06:33:31",
                "lastView": "2015-09-18 07:13:45"
            },
            "isSignedFor": 1,
            "signedFor": "2015-09-18 06:33:31",
            "reminders": null,
            "DELsmtpResponse": "250 Requested mail action okay, completed: partyID=0Lp694-1Z0BwJ2YwG-00exZY",
            "DELtimestamp": "2015-09-18 05:49:04",
            "DLs": "",
            "addedAfter": 0,
            "addedBy": "[email protected]",
            "sent": "2015-09-18 05:49:02",
            "bounced": 0,
            "isInitialBounce": 0,
            "isReminderBounce": 0,
            "bounceTimestamp": "",
            "bounceDiagnosticCode": "",
            "bounceAction": "",
            "canRemind": 1,
            "nextRemind": ""
        },
        {
            "partyID": 11440,
            "userID": 670,
            "email": "[email protected]",
            "name": "",
            "company": "",
            "isSender": 0,
            "isOwner": 0,
            "canEdit": 0,
            "unclaimedNoticeTimeout": "",
            "views": {
                "totalViews": 0,
                "firstView": "",
                "lastView": ""
            },
            "isSignedFor": 0,
            "signedFor": "",
            "reminders": [
                "2015-09-18 07:50:29",
                "2015-09-23 05:16:13"
            ],
            "DELsmtpResponse": "250 Requested mail action okay, completed: partyID=0MgvFm-1ZGtwd3Nw0-00M3Aq",
            "DELtimestamp": "2015-09-18 05:49:04",
            "DLs": "",
            "addedAfter": 0,
            "addedBy": "[email protected]",
            "sent": "2015-09-18 05:49:02",
            "bounced": 0,
            "isInitialBounce": 0,
            "isReminderBounce": 0,
            "bounceTimestamp": "",
            "bounceDiagnosticCode": "",
            "bounceAction": "",
            "canRemind": 0,
            "nextRemind": "2015-09-24 00:16:13"
        }
    ]
}

HTTP/1.1 403 Forbidden 

Content-Type: application/json

{
    code: 403,
    message: "User does not have authority to perform this action on this message."
}

HTTP/1.1 400 Bad Request 

Content-Type: application/json

{
    code: 400,
    message: "Problem with one of the request parameters."
}
Get Certification
GET /messages/{messageID}/documentation

A Certification is a PDF containing Docsmit’s official statement of detailed information about a message. It has information about the order placed and the production and delivery of the message’s mailpieces. It also contains a copy of the mailpiece’s content.

The first page of the PDF is the Certification, which states the addresses of each of the recipients, how it was sent to them (including any USPS tracking numbers), the dates and times of the order, mailing and delivery. The next pages are the content that was mailed in case there any argument is raised about the contents of the envelope. They are followed by any USPS generated Proof of Delivery forms for any certified mail (return receipt or return receipt electronic).

NOTE: the response is not JSON. The response is the actual PDF file.

Path variables

messageID
integer required

Message Id

Responses

200 OK

If document served as PDF

400 Not Found

MessageIDNot Found.

401 401

Email and password or token was not accepted.

403 403 - Unauthorized Access

User does not have authority to perform this action on this messageID.

Examples

Fetch & Serve Certification PDF.

GET http://secure.docsmit.com/api/v1/messages/1896/documentation HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$docsmit->get('/messages/1896/documentation', null);
if($docsmit->status() == 200)
{
    header('Cache-Control: public');
    header('Content-type: application/pdf');
    header('Content-Disposition: attachment; filename="Certifcation-1896.pdf"');                
}
echo $docsmit->responseBody();

HTTP/1.1 200 OK 
GET http://secure.docsmit.com/api/v1/messages/2045/documentation HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID,SECUREURL . "/api/v1");
$docsmit->get('/messages/2045/documentation', null);
if($docsmit->status() == 200)
{
    header('Cache-Control: public');
    header('Content-type: application/pdf');
    header('Content-Disposition: attachment; filename="documentation-2045.pdf"');                
}
echo $docsmit->responseBody();

HTTP/1.1 403 Forbidden 
Get Message and Recipients data
GET /messages/{messageId}/parties

Get data about the Message and the Recipents.

Path variables

messageId
integer required

The Message ID number

Responses

200 OK
Body
Object
id
string

Party Id

Example:
1902
rtnName
string

Name in the return address

Example:
Phil Jackson
rtnOrganization
string

Organization/Company in the return address

Example:
Chicago Bulls, Inc.
rtnAddress1
string

First address line in return address

Example:
1901 W Madison Street
rtnAddress2
string

Second address line in return address (optional)

Example:
Chicago Bulls Stadium
rtnCity
string

City in return address

Example:
Chicago
rtnState
string

State in return address

Example:
IL
rtnZip
string

Zip in return address. May be in either 5 digit or Zip+4 format

Examples:
6061260612-4123
accepted
string

The date and time it was accepted by Docsmit for sending. (i.e. after the user requested it be sent)

Examples:
2017-07-05 16:09:20000-00-00 00:00:00
isAccepted
string

Indicates it was accepted by Docsmit. (i.e. the “accepted” field is not zeroes)

Examples:
10
physicalParties

Contains an array of #MailAddressStatus

400 Bad Request

Invalid MessageId supplied. For example, if the message ID provided is not an integer.

401 401

Email and password or token was not accepted.

404 Not Found

MessageID not found.

Examples

GET http://secure.docsmit.com/api/v1/messages/1234/parties HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$params = array("view" => "1");
$docsmit->get("/messages/1234/parties",$params);
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

{
  "partyID": 11438,
  "userID": 321,
  "email": "[email protected]",
  "name": "shcnarola",
  "company": "",
  "isSender": 1,
  "isOwner": 1,
  "canEdit": 1,
  "unclaimedNoticeTimeout": "",
  "views": {
    "totalViews": 0,
    "firstView": "",
    "lastView": ""
  },
  "isSignedFor": 0,
  "signedFor": "",
  "reminders": null,
  "DELsmtpResponse": null,
  "DELtimestamp": "",
  "DLs": "",
  "addedAfter": 0,
  "addedBy": "[email protected]",
  "sent": "2015-09-18 05:49:02",
  "bounced": 0,
  "isInitialBounce": 0,
  "isReminderBounce": 0,
  "bounceTimestamp": "",
  "bounceDiagnosticCode": "",
  "bounceAction": "",
  "canRemind": 0,
  "nextRemind": ""
},
{
  "partyID": 11439,
  "userID": 339,
  "email": "[email protected]",
  "name": "Narola",
  "company": "",
  "isSender": 0,
  "isOwner": 0,
  "canEdit": 0,
  "unclaimedNoticeTimeout": "",
  "views": {
    "totalViews": 6,
    "firstView": "2015-09-18 06:33:31",
    "lastView": "2015-09-18 07:13:45"
  },
  "isSignedFor": 1,
  "signedFor": "2015-09-18 06:33:31",
  "reminders": null,
  "DELsmtpResponse": "250 Requested mail action okay, completed: partyID=0Lp694-1Z0BwJ2YwG-00exZY",
  "DELtimestamp": "2015-09-18 05:49:04",
  "DLs": "",
  "addedAfter": 0,
  "addedBy": "[email protected]",
  "sent": "2015-09-18 05:49:02",
  "bounced": 0,
  "isInitialBounce": 0,
  "isReminderBounce": 0,
  "bounceTimestamp": "",
  "bounceDiagnosticCode": "",
  "bounceAction": "",
  "canRemind": 1,
  "nextRemind": ""
},
{
  "partyID": 11440,
  "userID": 670,
  "email": "[email protected]",
  "name": "",
  "company": "",
  "isSender": 0,
  "isOwner": 0,
  "canEdit": 0,
  "unclaimedNoticeTimeout": "",
  "views": {
    "totalViews": 0,
    "firstView": "",
    "lastView": ""
  },
  "isSignedFor": 0,
  "signedFor": "",
  "reminders": [
    "2015-09-18 07:50:29",
    "2015-09-23 05:16:13"
  ],
  "DELsmtpResponse": "250 Requested mail action okay, completed: partyID=0MgvFm-1ZGtwd3Nw0-00M3Aq",
  "DELtimestamp": "2015-09-18 05:49:04",
  "DLs": "",
  "addedAfter": 0,
  "addedBy": "[email protected]",
  "sent": "2015-09-18 05:49:02",
  "bounced": 0,
  "isInitialBounce": 0,
  "isReminderBounce": 0,
  "bounceTimestamp": "",
  "bounceDiagnosticCode": "",
  "bounceAction": "",
  "canRemind": 1,
  "nextRemind": ""
}
Get attachments list
GET /messages/{messageID}/attachments

Return the information about the message attachments including id, fileId, fileName, size, attachmentId.

Path variables

messageID
integer required

Responses

200 OK
Body
Object
fileID
number
fileName
string
size
number
attachmentID
string
400 Bad Request

Invalid MessageID supplied.

401 401

Email and password or token was not accepted.

403 Forbidden
Body
Object
code
number
Example:
403
message
string
Example:
User does not have authority to perform this action on this message.

Examples

Get the attachments

GET http://secure.docsmit.com/api/v1/messages/1953/attachments HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$docsmit->get('/messages/1953/attachments');
$response = $docsmit->responseBody();

HTTP/1.1 403 Forbidden 

Content-Type: application/json

{
    "code": 403,
    "message": "User does not have authority to perform this action on this message."
}
GET http://secure.docsmit.com/api/v1/messages/975/attachments HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$docsmit->get('/messages/970/attachments');
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

[ 
    { 
        "fileID": 682,
        "fileName": "steve-jobs-quotes-about-life-352.jpg",
        "size": 74253,
        "attachmentID":
        "740"
    }, 
    {
        "fileID": 683, 
        "fileName": "images (1).jpg",
        "size": 19244, 
        "attachmentID": "741" 
    } 
]
Message transaction history
GET /messages/{messageID}/transactions

Returns all financial transactions for the Message.

Path variables

messageID
string required

Request parameters

messageID
number optional

2951

recipientID
number optional

Transactions can be filtered using recipientID.

Example:
324
to
string date optional

Transactions can be filter using to date.

Example:
2015-10-23
from
string date optional

Transactions can be filter using from date.

Example:
2015-10-30

Responses

200 OK

Returns the information about Transaction history for the particular message.

Body
Object
TransactionID
number
Example:
1000002165
DateTime
string
Example:
2015-10-28 15:59:10
CoR
string
Example:
C
discount
number
Example:
1.99
price
number
Months
number
Certs
number
Example:
1
MsgID
number
Example:
2951
CertType
string
Example:
pre
recipients
Array
Object
RecipientID
string
Example:
588
email
string
Name
string
Example:
recipient1 docsmit
400 Bad Request

Invalid MessageID supplied.

401 401

Email and password or token was not accepted.

Examples

GET http://secure.docsmit.com/api/v1/messages/2951/transactions HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$docsmit->get("/messages/2951/transactions");
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

[
    {
        "TransactionID": 1000002158,
        "DateTime": "2015-10-27 18:24:46",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002159,
        "DateTime": "2015-10-27 18:25:05",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002160,
        "DateTime": "2015-10-27 19:18:07",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002161,
        "DateTime": "2015-10-27 19:19:29",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002162,
        "DateTime": "2015-10-27 19:21:37",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002163,
        "DateTime": "2015-10-27 19:22:24",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002164,
        "DateTime": "2015-10-27 19:28:16",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002165,
        "DateTime": "2015-10-28 15:59:10",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002166,
        "DateTime": "2015-10-28 16:20:41",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002167,
        "DateTime": "2015-10-28 16:21:40",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002168,
        "DateTime": "2015-10-28 16:28:57",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002169,
        "DateTime": "2015-10-28 16:29:38",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002170,
        "DateTime": "2015-10-28 16:40:11",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002171,
        "DateTime": "2015-10-28 16:41:53",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002172,
        "DateTime": "2015-10-28 16:42:21",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002173,
        "DateTime": "2015-10-28 16:43:00",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002174,
        "DateTime": "2015-10-28 16:43:23",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002175,
        "DateTime": "2015-10-28 16:44:18",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002176,
        "DateTime": "2015-10-28 16:44:47",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002177,
        "DateTime": "2015-10-28 16:47:29",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002178,
        "DateTime": "2015-10-28 16:50:58",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002179,
        "DateTime": "2015-10-28 17:01:31",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002180,
        "DateTime": "2015-10-28 17:10:29",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002181,
        "DateTime": "2015-10-28 17:13:25",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002182,
        "DateTime": "2015-10-28 17:16:26",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002183,
        "DateTime": "2015-10-28 17:17:02",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002184,
        "DateTime": "2015-10-28 17:17:36",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002185,
        "DateTime": "2015-10-28 17:18:10",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002186,
        "DateTime": "2015-10-28 17:24:34",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002187,
        "DateTime": "2015-10-28 17:30:28",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    }
]

Transactions can be filter using RecipientID

GET http://secure.docsmit.com/api/v1/messages/2951/transactions HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$params = array("recipientID"=>588);
$docsmit->get("/messages/2951/transactions",$params);
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

[
    {
        "TransactionID": 1000002158,
        "DateTime": "2015-10-27 18:24:46",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002159,
        "DateTime": "2015-10-27 18:25:05",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002160,
        "DateTime": "2015-10-27 19:18:07",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002161,
        "DateTime": "2015-10-27 19:19:29",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002162,
        "DateTime": "2015-10-27 19:21:37",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002163,
        "DateTime": "2015-10-27 19:22:24",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002164,
        "DateTime": "2015-10-27 19:28:16",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002165,
        "DateTime": "2015-10-28 15:59:10",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002166,
        "DateTime": "2015-10-28 16:20:41",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002167,
        "DateTime": "2015-10-28 16:21:40",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002168,
        "DateTime": "2015-10-28 16:28:57",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002169,
        "DateTime": "2015-10-28 16:29:38",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002170,
        "DateTime": "2015-10-28 16:40:11",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002171,
        "DateTime": "2015-10-28 16:41:53",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002172,
        "DateTime": "2015-10-28 16:42:21",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002173,
        "DateTime": "2015-10-28 16:43:00",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002174,
        "DateTime": "2015-10-28 16:43:23",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002175,
        "DateTime": "2015-10-28 16:44:18",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002176,
        "DateTime": "2015-10-28 16:44:47",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002177,
        "DateTime": "2015-10-28 16:47:29",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002178,
        "DateTime": "2015-10-28 16:50:58",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002179,
        "DateTime": "2015-10-28 17:01:31",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002180,
        "DateTime": "2015-10-28 17:10:29",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002181,
        "DateTime": "2015-10-28 17:13:25",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002182,
        "DateTime": "2015-10-28 17:16:26",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002183,
        "DateTime": "2015-10-28 17:17:02",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002184,
        "DateTime": "2015-10-28 17:17:36",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002185,
        "DateTime": "2015-10-28 17:18:10",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002186,
        "DateTime": "2015-10-28 17:24:34",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002187,
        "DateTime": "2015-10-28 17:30:28",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    }
]

Transactions can be filter using either to date or from date or both.

GET http://secure.docsmit.com/api/v1/messages/2951/transactions HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$params = array("from"=>"2015-10-28");
$docsmit->get("/messages/2951/transactions",$params);
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

[
    {
        "TransactionID": 1000002165,
        "DateTime": "2015-10-28 15:59:10",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002166,
        "DateTime": "2015-10-28 16:20:41",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002167,
        "DateTime": "2015-10-28 16:21:40",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002168,
        "DateTime": "2015-10-28 16:28:57",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002169,
        "DateTime": "2015-10-28 16:29:38",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002170,
        "DateTime": "2015-10-28 16:40:11",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002171,
        "DateTime": "2015-10-28 16:41:53",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002172,
        "DateTime": "2015-10-28 16:42:21",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002173,
        "DateTime": "2015-10-28 16:43:00",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002174,
        "DateTime": "2015-10-28 16:43:23",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002175,
        "DateTime": "2015-10-28 16:44:18",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002176,
        "DateTime": "2015-10-28 16:44:47",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002177,
        "DateTime": "2015-10-28 16:47:29",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002178,
        "DateTime": "2015-10-28 16:50:58",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002179,
        "DateTime": "2015-10-28 17:01:31",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002180,
        "DateTime": "2015-10-28 17:10:29",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002181,
        "DateTime": "2015-10-28 17:13:25",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002182,
        "DateTime": "2015-10-28 17:16:26",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002183,
        "DateTime": "2015-10-28 17:17:02",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002184,
        "DateTime": "2015-10-28 17:17:36",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002185,
        "DateTime": "2015-10-28 17:18:10",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002186,
        "DateTime": "2015-10-28 17:24:34",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    },
    {
        "TransactionID": 1000002187,
        "DateTime": "2015-10-28 17:30:28",
        "CoR": "C",
        "discount": 1.99,
        "price": 0,
        "Months": 0,
        "Certs": 1,
        "MsgID": 2951,
        "CertType": "pre",
        "recipients": [
            {
                "RecipientID": "588",
                "email": "[email protected]",
                "Name": "recipient1 docsmit"
            }
        ]
    }
]
Download file attachment
GET /messages/{messageId}/download/{fileId}

Path variables

messageId
integer required
fileId
integer required

Responses

200 OK

Download success.

400 Bad Request

Invalid MessageId/fileId supplied.

401 401

Email and password or token was not accepted.

Examples

GET http://secure.docsmit.com/api/v1/messages/1234/download/236 HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$docsmit->get("/messages/1234/download/236");
$status = $docsmit->status();
$response = $docsmit->responseBody();
Download Zip attachment
GET /messages/{messageID}/download/{ZipID}

Path variables

messageID
integer required
ZipID
integer required

Responses

200 OK

Download Success.

400 Bad Request

Invalid MessageID/ZipID supply.

401 401

Email and password or token was not accepted.

Account

Deals with purchased credit.

GET /messages/sent
GET /messages/draft
GET /account/info
Sent list
GET /messages/sent

Get the list of messages that have been sent.

Request parameters

clientMsgID
string optional

Sent messages can be filtered using clientMsgID param. It will return all the sent messages which match exactly the specified clientMsgID.

Example:
"1400.3.0011"
turnOffSoftwareID
string optional

Normally only sent messages sent with the calling SoftwareID are returned. If the call is made with turnOffSoftwareID set to be true, it will return all the sent messages from the user without filtering based on softwareID.

Example:
1
clientMsgID_MR
string optional

Sent messages can be filter using clientMsgID_MR param. This parameter accepts MySQL style REGEX. It will list all the messages which match the regex.

Examples:
^1400[abc]ab$
recipient
string optional

Sent message can be filter using recipient. It will return all the sent messages where the string exactly matches a recipeint.

Example:
"Ashish"
messageIDList
string optional

A list of comma separated values. If this is included messages with exactly matching MessageIDs will be returned.

Example:
"42255,44790, 44891, 49106"
clientMsgIDList
string optional

A list of comma separated values. If this is included messages with exactly matching clientMsgIDs will be returned. There should no spaces between each item in the CSV list.

Example:
"1400.3.0011,Johnson-14"

Responses

200 OK

Everything worked as expected

Body
Object
id
number

MessageID

from
string
title
string
to
Object
email
string
unread
string
SignedFor
string date
attachments
boolean
threadRoot
string
certified
number
attSize
string
sent
string
Example:
0000-00-00 00:00:00
transaction
string
Examples:
cpfa
bookmarked
number
isFlagged
number
deliverAfter
string
Example:
2015-04-16 12:49:00
isDeliverAfter
boolean
isSent
number
isBlastMessage
boolean
totalRecipientsCount
number
totalUnsignedCount
string
isBounced
boolean
bouncedMsgStr
string
Example:
Bounced : 2 (Inital : 1/Reminder :1)
isEncrypted
number
initialBouncedMsgRecipients
Object
email
string
reminderBouncedMsgRecipients
Object
email
string
alreadySentType
string
Examples:
SRNSRBOTH
SRSent
string date
NSRSent
string date
Example:
2015-04-16 16:49:00
SRDeliverAfter
string date
Example:
2015-04-16 16:49:00
NSRDeliverAfter
string date
Example:
0000-00-00 00:00:00
401 401

Email and password or token was not accepted.

403 403 - Unauthorized Access

User does not have authority to perform this action on this messageID.

Examples

GET http://secure.docsmit.com/api/v1/messages/sent HTTP/1.1 

HTTP/1.1 200 OK 

Content-Type: application/json

{
  "messageID": "690",
  "from": "shcnarola",
  "title": "Docsmit Message",
  "to": [
    {
      "email": "[email protected]",
      "unread": "1",
      "SignedFor": "2015-01-01T13:00:00"
    },
    {
      "email": "[email protected]",
      "unread": "1",
      "SignedFor": "2015-01-01T13:00:00"
    },
    {
      "email": "[email protected]",
      "unread": "1",
      "SignedFor": "2015-01-01T13:00:00"
    }
  ],
  "attachments": true,
  "threadRoot": "690",
  "certified": 1,
  "attSize": "0",
  "sent": "0000-00-00 00:00:00",
  "transaction": "c",
  "bookmarked": 1,
  "isFlagged": 1,
  "deliverAfter": "2015-04-16 12:49:00",
  "isDeliverAfter": "1",
  "isSent": 1,
  "isBlastMessage": true,
  "totalRecipientsCount": "1",
  "totalUnsignedCount": "1",
  "isBounced": true,
  "bouncedMsgStr": "Bounced : 2 (Inital : 1/Reminder :1)",
  "isEncrypted": 1,
  "initialBouncedMsgRecipients": [
    {
      "email": "[email protected]"
    }
  ],
  "reminderBouncedMsgRecipients": [
    {
      "email": "[email protected]"
    }
  ],
  "alreadySentType": "SR",
  "SRSent": "2015-01-01T13:00:00",
  "NSRSent": "2015-04-16 16:49:00",
  "SRDeliverAfter": "2015-04-16 16:49:00",
  "NSRDeliverAfter": "0000-00-00 00:00:00"
}

List all Sent Messages

GET http://secure.docsmit.com/api/v1/messages/sent HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID, "http://secure.docsmit.com/api/v1");
$docsmit->get('/messages/sent');
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": 1,
    "from": "",
    "title": "",
    "to": [
        {
            "email": "",
            "unread": "",
            "SignedFor": "2015-01-01T13:00:00"
        }
    ],
    "attachments": true,
    "threadRoot": "",
    "certified": 1,
    "attSize": "",
    "sent": "0000-00-00 00:00:00",
    "transaction": "c",
    "bookmarked": 1,
    "isFlagged": 1,
    "deliverAfter": "2015-04-16 12:49:00",
    "isDeliverAfter": true,
    "isSent": 1,
    "isBlastMessage": true,
    "totalRecipientsCount": 1,
    "totalUnsignedCount": "",
    "isBounced": true,
    "bouncedMsgStr": "Bounced : 2 (Inital : 1/Reminder :1)",
    "isEncrypted": 1,
    "initialBouncedMsgRecipients": [
        {
            "email": ""
        }
    ],
    "reminderBouncedMsgRecipients": [
        {
            "email": ""
        }
    ],
    "alreadySentType": "SR",
    "SRSent": "2015-01-01T13:00:00",
    "NSRSent": "2015-04-16 16:49:00",
    "SRDeliverAfter": "2015-04-16 16:49:00",
    "NSRDeliverAfter": "0000-00-00 00:00:00"
}

Retrieve unsigned messages from sent. User can filter sent message by specifying unsigned search param. The valid value for this param is true, false, 1, ‘0’. It will retrieve all the messages which matches the specified value for unsigned param from sent.

GET http://secure.docsmit.com/api/v1/messages/sent?unsigned=true HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID, "http://secure.docsmit.com/api/v1");
$params["unsigned"]= "true";
$docsmit->get('/messages/sent', $params);
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "messageID": 1,
    "from": "",
    "title": "",
    "to": [
        {
            "email": "",
            "unread": "",
            "SignedFor": "2015-01-01T13:00:00"
        }
    ],
    "attachments": true,
    "threadRoot": "",
    "certified": 1,
    "attSize": "",
    "sent": "0000-00-00 00:00:00",
    "transaction": "c",
    "bookmarked": 1,
    "isFlagged": 1,
    "deliverAfter": "2015-04-16 12:49:00",
    "isDeliverAfter": true,
    "isSent": 1,
    "isBlastMessage": true,
    "totalRecipientsCount": 1,
    "totalUnsignedCount": "",
    "isBounced": true,
    "bouncedMsgStr": "Bounced : 2 (Inital : 1/Reminder :1)",
    "isEncrypted": 1,
    "initialBouncedMsgRecipients": [
        {
            "email": ""
        }
    ],
    "reminderBouncedMsgRecipients": [
        {
            "email": ""
        }
    ],
    "alreadySentType": "SR",
    "SRSent": "2015-01-01T13:00:00",
    "NSRSent": "2015-04-16 16:49:00",
    "SRDeliverAfter": "2015-04-16 16:49:00",
    "NSRDeliverAfter": "0000-00-00 00:00:00"
}

Sent messages can be filter by specifying clientMsgID search params. It will retrieve all the messages which matches the specified clientMsgID from Sent messages.

GET http://secure.docsmit.com/api/v1/messages/sent?clientMsgID="clientmsgidgoeshere" HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID, "http://secure.docsmit.com/api/v1");
$params["clientMsgID"] = "test123";
$docsmit->get('/messages/sent', $params);
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "messageID": 1,
    "from": "",
    "title": "",
    "to": [
        {
            "email": "",
            "unread": "",
            "SignedFor": "2015-01-01T13:00:00"
        }
    ],
    "attachments": true,
    "threadRoot": "",
    "certified": 1,
    "attSize": "",
    "sent": "0000-00-00 00:00:00",
    "transaction": "c",
    "bookmarked": 1,
    "isFlagged": 1,
    "deliverAfter": "2015-04-16 12:49:00",
    "isDeliverAfter": true,
    "isSent": 1,
    "isBlastMessage": true,
    "totalRecipientsCount": 1,
    "totalUnsignedCount": "",
    "isBounced": true,
    "bouncedMsgStr": "Bounced : 2 (Inital : 1/Reminder :1)",
    "isEncrypted": 1,
    "initialBouncedMsgRecipients": [
        {
            "email": ""
        }
    ],
    "reminderBouncedMsgRecipients": [
        {
            "email": ""
        }
    ],
    "alreadySentType": "SR",
    "SRSent": "2015-01-01T13:00:00",
    "NSRSent": "2015-04-16 16:49:00",
    "SRDeliverAfter": "2015-04-16 16:49:00",
    "NSRDeliverAfter": "0000-00-00 00:00:00"
}
GET http://secure.docsmit.com/api/v1/messages/sent?turnOffSoftwareID=true HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID,"http://secure.docsmit.com/api/v1");
$params["turnOffSoftwareID"] = "true";
$docsmit->get('/messages/sent');
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": 1,
    "from": "",
    "title": "",
    "to": [
        {
            "email": "",
            "unread": "",
            "SignedFor": "2015-01-01T13:00:00"
        }
    ],
    "attachments": true,
    "threadRoot": "",
    "certified": 1,
    "attSize": "",
    "sent": "0000-00-00 00:00:00",
    "transaction": "c",
    "bookmarked": 1,
    "isFlagged": 1,
    "deliverAfter": "2015-04-16 12:49:00",
    "isDeliverAfter": true,
    "isSent": 1,
    "isBlastMessage": true,
    "totalRecipientsCount": 1,
    "totalUnsignedCount": "",
    "isBounced": true,
    "bouncedMsgStr": "Bounced : 2 (Inital : 1/Reminder :1)",
    "isEncrypted": 1,
    "initialBouncedMsgRecipients": [
        {
            "email": ""
        }
    ],
    "reminderBouncedMsgRecipients": [
        {
            "email": ""
        }
    ],
    "alreadySentType": "SR",
    "SRSent": "2015-01-01T13:00:00",
    "NSRSent": "2015-04-16 16:49:00",
    "SRDeliverAfter": "2015-04-16 16:49:00",
    "NSRDeliverAfter": "0000-00-00 00:00:00"
}
GET http://secure.docsmit.com/api/v1/messages/sent HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID, "http://secure.docsmit.com/api/v1");
$params["clientMsgID_MR"] = "^[ab]|rs$";
$docsmit->get('/messages/sent',$params);
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": 1,
    "from": "",
    "title": "",
    "to": [
        {
            "email": "",
            "unread": "",
            "SignedFor": "2015-01-01T13:00:00"
        }
    ],
    "attachments": true,
    "threadRoot": "",
    "certified": 1,
    "attSize": "",
    "sent": "0000-00-00 00:00:00",
    "transaction": "c",
    "bookmarked": 1,
    "isFlagged": 1,
    "deliverAfter": "2015-04-16 12:49:00",
    "isDeliverAfter": true,
    "isSent": 1,
    "isBlastMessage": true,
    "totalRecipientsCount": 1,
    "totalUnsignedCount": "",
    "isBounced": true,
    "bouncedMsgStr": "Bounced : 2 (Inital : 1/Reminder :1)",
    "isEncrypted": 1,
    "initialBouncedMsgRecipients": [
        {
            "email": ""
        }
    ],
    "reminderBouncedMsgRecipients": [
        {
            "email": ""
        }
    ],
    "alreadySentType": "SR",
    "SRSent": "2015-01-01T13:00:00",
    "NSRSent": "2015-04-16 16:49:00",
    "SRDeliverAfter": "2015-04-16 16:49:00",
    "NSRDeliverAfter": "0000-00-00 00:00:00"
}

Sent messages can be fileter by specifying messageIDList search params. It will retrieve all the messages which matches the specified messageID List from sent.

GET http://secure.docsmit.com/api/v1/messages/sent HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID, "http://secure.docsmit.com/api/v1");
$params["messageIDList"] = "1086,1087";
$docsmit->get('/messages/sent', $params);
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

[
    {
        "messageID": 1087,
        "from": "[email protected]",
        "title": "This is new message title from Hiren testcase",
        "to": [
            {
                "email": "[email protected]",
                "unread": "1",
                "SignedFor": null
            }
        ],
        "attachments": 0,
        "threadRoot": 1087,
        "certified": 1,
        "attSize": 0,
        "sent": "2015-08-31 08:16:28",
        "transaction": "c",
        "bookmarked": 0,
        "isFlagged": 0,
        "deliverAfter": "0000-00-00 00:00:00",
        "isDeliverAfter": 0,
        "isSent": 1,
        "isBlastMessage": 0,
        "totalRecipientsCount": 1,
        "totalUnsignedCount": "1",
        "isBounced": false,
        "bouncedMsgStr": "Bounced : 0 (Inital : 0/Reminder :0)",
        "isEncrypted": 0,
        "initialBouncedMsgRecipients": [],
        "reminderBouncedMsgRecipients": [],
        "alreadySentType": "SR",
        "SRSent": "2015-08-31 12:16:28",
        "NSRSent": "0000-00-00 00:00:00",
        "SRDeliverAfter": "0000-00-00 00:00:00",
        "NSRDeliverAfter": "0000-00-00 00:00:00",
        "clientMsgID": null,
        "softwareID": "12345678901234567890123456789012"
    },
    {
        "id": 1086,
        "from": "[email protected]",
        "title": "This is new message title from Hiren testcase",
        "to": [
            {
                "email": "[email protected]",
                "unread": "1",
                "SignedFor": null
            }
        ],
        "attachments": 0,
        "threadRoot": 1086,
        "certified": 1,
        "attSize": 0,
        "sent": "2015-08-31 08:14:40",
        "transaction": "c",
        "bookmarked": 0,
        "isFlagged": 0,
        "deliverAfter": "0000-00-00 00:00:00",
        "isDeliverAfter": 0,
        "isSent": 1,
        "isBlastMessage": 0,
        "totalRecipientsCount": 1,
        "totalUnsignedCount": "1",
        "isBounced": false,
        "bouncedMsgStr": "Bounced : 0 (Inital : 0/Reminder :0)",
        "isEncrypted": 0,
        "initialBouncedMsgRecipients": [],
        "reminderBouncedMsgRecipients": [],
        "alreadySentType": "SR",
        "SRSent": "2015-08-31 12:14:40",
        "NSRSent": "0000-00-00 00:00:00",
        "SRDeliverAfter": "0000-00-00 00:00:00",
        "NSRDeliverAfter": "0000-00-00 00:00:00",
        "clientMsgID": null,
        "softwareID": "12345678901234567890123456789012"
    }
]

Sent messages can be fileter by specifying clientMsgIDList search params. It will retrieve all the messages which matches the specified clientMsgID List from Sent.

GET http://secure.docsmit.com/api/v1/messages/sent HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID, "http://secure.docsmit.com/api/v1");
$params["clientMsgIDList"] = "test123,test456";
$docsmit->get('/messages/sent', $params);
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

[
    {
        "messageID": 1090,
        "from": "[email protected]",
        "title": "This is new message title from Hiren testcase",
        "to": [
            {
                "email": "[email protected]",
                "unread": "1",
                "SignedFor": null
            }
        ],
        "attachments": 0,
        "threadRoot": 1090,
        "certified": 1,
        "attSize": 0,
        "sent": "2015-08-31 08:20:22",
        "transaction": "c",
        "bookmarked": 0,
        "isFlagged": 0,
        "deliverAfter": "0000-00-00 00:00:00",
        "isDeliverAfter": 0,
        "isSent": 1,
        "isBlastMessage": 0,
        "totalRecipientsCount": 1,
        "totalUnsignedCount": "1",
        "isBounced": false,
        "bouncedMsgStr": "Bounced : 0 (Inital : 0/Reminder :0)",
        "isEncrypted": 0,
        "initialBouncedMsgRecipients": [],
        "reminderBouncedMsgRecipients": [],
        "alreadySentType": "SR",
        "SRSent": "2015-08-31 12:20:22",
        "NSRSent": "0000-00-00 00:00:00",
        "SRDeliverAfter": "0000-00-00 00:00:00",
        "NSRDeliverAfter": "0000-00-00 00:00:00",
        "clientMsgID": "test123",
        "softwareID": "12345678901234567890123456789012"
    }
]

Sent messages can be fileter by specifying clientMsgIDs as well messageIDs search params. It will retrieve all the messages which matches the specified clientMsgID and messageID from sent.

GET http://secure.docsmit.com/api/v1/messages/sent HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID, "http://secure.docsmit.com/api/v1");
$params["messageIDList"] = "1086,1087";
$params["clientMsgIDList"] = "test123";
$docsmit->get('/messages/sent', $params);
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

[
    {
        "messageID": 1090,
        "from": "[email protected]",
        "title": "This is new message title from Hiren testcase",
        "to": [
            {
                "email": "[email protected]",
                "unread": "1",
                "SignedFor": null
            }
        ],
        "attachments": 0,
        "threadRoot": 1090,
        "certified": 1,
        "attSize": 0,
        "sent": "2015-08-31 08:20:22",
        "transaction": "c",
        "bookmarked": 0,
        "isFlagged": 0,
        "deliverAfter": "0000-00-00 00:00:00",
        "isDeliverAfter": 0,
        "isSent": 1,
        "isBlastMessage": 0,
        "totalRecipientsCount": 1,
        "totalUnsignedCount": "1",
        "isBounced": false,
        "bouncedMsgStr": "Bounced : 0 (Inital : 0/Reminder :0)",
        "isEncrypted": 0,
        "initialBouncedMsgRecipients": [],
        "reminderBouncedMsgRecipients": [],
        "alreadySentType": "SR",
        "SRSent": "2015-08-31 12:20:22",
        "NSRSent": "0000-00-00 00:00:00",
        "SRDeliverAfter": "0000-00-00 00:00:00",
        "NSRDeliverAfter": "0000-00-00 00:00:00",
        "clientMsgID": "test123",
        "softwareID": "12345678901234567890123456789012"
    },
    {
        "messageID": 1087,
        "from": "[email protected]",
        "title": "This is new message title from Hiren testcase",
        "to": [
            {
                "email": "[email protected]",
                "unread": "1",
                "SignedFor": null
            }
        ],
        "attachments": 0,
        "threadRoot": 1087,
        "certified": 1,
        "attSize": 0,
        "sent": "2015-08-31 08:16:28",
        "transaction": "c",
        "bookmarked": 0,
        "isFlagged": 0,
        "deliverAfter": "0000-00-00 00:00:00",
        "isDeliverAfter": 0,
        "isSent": 1,
        "isBlastMessage": 0,
        "totalRecipientsCount": 1,
        "totalUnsignedCount": "1",
        "isBounced": false,
        "bouncedMsgStr": "Bounced : 0 (Inital : 0/Reminder :0)",
        "isEncrypted": 0,
        "initialBouncedMsgRecipients": [],
        "reminderBouncedMsgRecipients": [],
        "alreadySentType": "SR",
        "SRSent": "2015-08-31 12:16:28",
        "NSRSent": "0000-00-00 00:00:00",
        "SRDeliverAfter": "0000-00-00 00:00:00",
        "NSRDeliverAfter": "0000-00-00 00:00:00",
        "clientMsgID": null,
        "softwareID": "12345678901234567890123456789012"
    },
    {
        "messageID": 1086,
        "from": "[email protected]",
        "title": "This is new message title from Hiren testcase",
        "to": [
            {
                "email": "[email protected]",
                "unread": "1",
                "SignedFor": null
            }
        ],
        "attachments": 0,
        "threadRoot": 1086,
        "certified": 1,
        "attSize": 0,
        "sent": "2015-08-31 08:14:40",
        "transaction": "c",
        "bookmarked": 0,
        "isFlagged": 0,
        "deliverAfter": "0000-00-00 00:00:00",
        "isDeliverAfter": 0,
        "isSent": 1,
        "isBlastMessage": 0,
        "totalRecipientsCount": 1,
        "totalUnsignedCount": "1",
        "isBounced": false,
        "bouncedMsgStr": "Bounced : 0 (Inital : 0/Reminder :0)",
        "isEncrypted": 0,
        "initialBouncedMsgRecipients": [],
        "reminderBouncedMsgRecipients": [],
        "alreadySentType": "SR",
        "SRSent": "2015-08-31 12:14:40",
        "NSRSent": "0000-00-00 00:00:00",
        "SRDeliverAfter": "0000-00-00 00:00:00",
        "NSRDeliverAfter": "0000-00-00 00:00:00",
        "clientMsgID": null,
        "softwareID": "12345678901234567890123456789012"
    }
]

Sent messages can be filter using sender param.

GET http://secure.docsmit.com/api/v1/messages/sent HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID, "http://secure.docsmit.com/api/v1");
$params["sender"] = "[email protected]";
$docsmit->get('/messages/sent', $params);
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

{
  "messageID": 2923,
  "from": "[email protected]",
  "title": "This is message title from REST API",
  "to": [
    {
      "email": "[email protected]",
      "unread": "1",
      "SignedFor": null
    }
  ],
  "attachments": 0,
  "threadRoot": 2923,
  "certified": 1,
  "attSize": 0,
  "sent": "2015-09-23 10:23:43",
  "transaction": "c",
  "bookmarked": 0,
  "isFlagged": 0,
  "isDeliverAfter": 0,
  "isSent": 1,
  "isBlastMessage": 0,
  "totalRecipientsCount": 1,
  "totalUnsignedCount": "1",
  "isEncrypted": 0,
  "alreadySentType": "SR",
  "SRSent": "2015-09-23 10:23:43",
  "NSRSent": "0000-00-00 00:00:00",
  "SRDeliverAfter": "0000-00-00 00:00:00",
  "NSRDeliverAfter": "0000-00-00 00:00:00",
  "clientMsgID": "safdsdfds123",
  "softwareID": "12345678901234567890123456789012",
  "isBounced": false,
  "bouncedMsgCount": {
    "total": 0,
    "initialBounce": "0",
    "reminderBounce": "0"
  }
}

Sent message can be filter using recipient. It will return all the sent messages which belogs specified recipient.

GET http://secure.docsmit.com/api/v1/messages/sent HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID, "http://secure.docsmit.com/api/v1");
$params["recipient"] = "[email protected]";
$docsmit->get('/messages/sent', $params);
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

{
  "messageID": 2923,
  "from": "[email protected]",
  "title": "This is message title from REST API",
  "to": [
    {
      "email": "[email protected]",
      "unread": "1",
      "SignedFor": null
    }
  ],
  "attachments": 0,
  "threadRoot": 2923,
  "certified": 1,
  "attSize": 0,
  "sent": "2015-09-23 10:23:43",
  "transaction": "c",
  "bookmarked": 0,
  "isFlagged": 0,
  "isDeliverAfter": 0,
  "isSent": 1,
  "isBlastMessage": 0,
  "totalRecipientsCount": 1,
  "totalUnsignedCount": "1",
  "isEncrypted": 0,
  "alreadySentType": "SR",
  "SRSent": "2015-09-23 10:23:43",
  "NSRSent": "0000-00-00 00:00:00",
  "SRDeliverAfter": "0000-00-00 00:00:00",
  "NSRDeliverAfter": "0000-00-00 00:00:00",
  "clientMsgID": "safdsdfds123",
  "softwareID": "12345678901234567890123456789012",
  "isBounced": false,
  "bouncedMsgCount": {
    "total": 0,
    "initialBounce": "0",
    "reminderBounce": "0"
  }
}
Draft list
GET /messages/draft

Get the list of unsent (draft) messages.

Request parameters

clientMsgID
string optional

Draft messages can be filtered using clientMsgID.

Example:
validclientmessageid
turnOffSoftwareID
boolean optional

By default draft messages are filtered using softwareID. To turn of this filter use turnOffSoftwareID param.

Example:
true
clientMsgID_MR
string optional

Draft messages can be filter using clientMsgID_MR param. This parameter accepts MySQL REGEX. It will list all the messages which matches specified regex.

Examples:
^abababc$
messageIDList
string optional

Draft messages can be filter using messageIDList param. It will return all the draft messages filter using messageIDList.

Example:
1084,1080
clientMsgIDList
string optional

Draft messages can be filter using clientMsgIDList param. It will return all the draft messages filter using clientMsgIDList.

Example:
safdsdfds123,demoemailclientmsgid

Responses

200 OK
Body
Object
id
number
Example:
847
from
Object
email
string
unread
string
fromList
Object
email
string
unread
string
title
string
to
Object
email
string
unread
string
attSize
string
Example:
777835
attachments
boolean
Example:
true
401 401

Email and password or token was not accepted.

Examples

GET http://secure.docsmit.com/api/v1/messages/draft HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);                                
$docsmit->get('/messages/draft');
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "messageID": 847,
    "from": {
      "email": [
        "[email protected]"
      ],
      "unread": [
        "1"
      ]
    },
    "fromList": {
      "email": [
        "[email protected]"
      ],
      "unread": [
        "1"
      ]
    },
    "title": "",
    "to": {
      "email": [
        "[email protected]",
        "[email protected]",
        "[email protected]",
        "[email protected]"
      ],
      "unread": [
        "1",
        "1",
        "1",
        "1"
      ]
    },
    "attSize": "777835",
    "attachments": true
  }
GET http://secure.docsmit.com/api/v1/messages/draft HTTP/1.1 

Content-Type: application/json

$email ="123";
$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$docsmit->get('/messages/draft');
$response = $docsmit->responseBody();

HTTP/1.1 401 Unauthorized 

Content-Type: application/json

{
    "code": {
        "value": "401"
    },
    "message": {
        "value": "Authentication Failed"
    }
}
GET http://secure.docsmit.com/api/v1/messages/draft HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$params["clientMsgID"] = "test123";
$docsmit->get('/messages/draft');
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "messageID": 847,
    "from": {
      "email": [
        "[email protected]"
      ],
      "unread": [
        "1"
      ]
    },
    "fromList": {
      "email": [
        "[email protected]"
      ],
      "unread": [
        "1"
      ]
    },
    "title": "",
    "to": {
      "email": [
        "[email protected]",
        "[email protected]",
        "[email protected]",
        "[email protected]"
      ],
      "unread": [
        "1",
        "1",
        "1",
        "1"
      ]
    },
    "attSize": "777835",
    "attachments": true
  }
GET http://secure.docsmit.com/api/v1/messages/draft?turnOffSoftwareID=true HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$params["turnOffSoftwareID"] = "true"; // or true,1
$docsmit->get('/messages/draft', $params);
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "messageID": 847,
    "from": {
      "email": [
        "[email protected]"
      ],
      "unread": [
        "1"
      ]
    },
    "fromList": {
      "email": [
        "[email protected]"
      ],
      "unread": [
        "1"
      ]
    },
    "title": "",
    "to": {
      "email": [
        "[email protected]",
        "[email protected]",
        "[email protected]",
        "[email protected]"
      ],
      "unread": [
        "1",
        "1",
        "1",
        "1"
      ]
    },
    "attSize": "777835",
    "attachments": true
  }
GET http://secure.docsmit.com/api/v1/messages/draft HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$params["clientMsgID_MR"] = "^[ab]|rs$";
$docsmit->get('/messages/draft');
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "messageID": "847",
    "from": {
        "email": [
            ""
        ],
        "unread": [
            ""
        ]
    },
    "fromList": {
        "email": [
            ""
        ],
        "unread": [
            ""
        ]
    },
    "title": "",
    "to": {
        "email": [
            ""
        ],
        "unread": [
            ""
        ]
    },
    "attSize": "777835",
    "attachments": "true"
}

Draft messages can be fileter by specifying messageIDList search params. It will retrieve all the messages which matches the specified messageID List from draft.

GET http://secure.docsmit.com/api/v1/messages/draft HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$params['messageIDList'] = '1084,1080';
$docsmit->get('/messages/draft', $params);
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

[
    {
        "messageID": 1084,
        "from": {
            "email": [
                "[email protected]"
            ],
            "unread": [
                "1"
            ]
        },
        "fromList": {
            "email": [
                "[email protected]"
            ],
            "unread": [
                "1"
            ]
        },
        "title": "This is message title from REST API",
        "attSize": 0,
        "to": [],
        "attachments": false,
        "clientMsgID": "",
        "softwareID": "12345678901234567890123456789012"
    },
    {
        "id": 1080,
        "from": {
            "email": [
                "[email protected]"
            ],
            "unread": [
                "1"
            ]
        },
        "fromList": {
            "email": [
                "[email protected]"
            ],
            "unread": [
                "1"
            ]
        },
        "title": "This is new message title from Hiren testcase",
        "attSize": 0,
        "to": {
            "email": [
                "[email protected]"
            ],
            "unread": [
                "1"
            ]
        },
        "attachments": false,
        "clientMsgID": null,
        "softwareID": "12345678901234567890123456789012"
    }
]

Draft messages can be fileter by specifying clientMsgIDList search params. It will retrieve all the messages which matches the specified clientMsgID List from draft.

GET http://secure.docsmit.com/api/v1/messages/draft HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$params["clientMsgIDList"] = 'safdsdfds123,demoemailclientmsgid';
$docsmit->get('/messages/draft', $params);
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

[
    {
        "messageID": 1079,
        "from": {
            "email": [
                "[email protected]"
            ],
            "unread": [
                "1"
            ]
        },
        "fromList": {
            "email": [
                "[email protected]"
            ],
            "unread": [
                "1"
            ]
        },
        "title": "This is message title from REST API",
        "attSize": 0,
        "to": [],
        "attachments": false,
        "clientMsgID": "safdsdfds123",
        "softwareID": "12345678901234567890123456789012"
    }
]

Draft messages can be fileter by specifying clientMsgIDs as well messageIDs search params. It will retrieve all the messages which matches the specified clientMsgID and messageID from draft.

GET http://secure.docsmit.com/api/v1/messages/draft HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$params["messageIDList"] = '1084,1080';
$params["clientMsgIDList"] = 'safdsdfds123,demoemailclientmsgid';
$docsmit->get('/messages/draft', $params);
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

[
    {
        "messageID": 1084,
        "from": {
            "email": [
                "[email protected]"
            ],
            "unread": [
                "1"
            ]
        },
        "fromList": {
            "email": [
                "[email protected]"
            ],
            "unread": [
                "1"
            ]
        },
        "title": "This is message title from REST API",
        "attSize": 0,
        "to": [],
        "attachments": false,
        "clientMsgID": "",
        "softwareID": "12345678901234567890123456789012"
    },
    {
        "id": 1080,
        "from": {
            "email": [
                "[email protected]"
            ],
            "unread": [
                "1"
            ]
        },
        "fromList": {
            "email": [
                "[email protected]"
            ],
            "unread": [
                "1"
            ]
        },
        "title": "This is new message title from Hiren testcase",
        "attSize": 0,
        "to": {
            "email": [
                "[email protected]"
            ],
            "unread": [
                "1"
            ]
        },
        "attachments": false,
        "clientMsgID": null,
        "softwareID": "12345678901234567890123456789012"
    },
    {
        "id": 1079,
        "from": {
            "email": [
                "[email protected]"
            ],
            "unread": [
                "1"
            ]
        },
        "fromList": {
            "email": [
                "[email protected]"
            ],
            "unread": [
                "1"
            ]
        },
        "title": "This is message title from REST API",
        "attSize": 0,
        "to": [],
        "attachments": false,
        "clientMsgID": "safdsdfds123",
        "softwareID": "12345678901234567890123456789012"
    }
]
User Account Information
GET /account/info

Returns information about the currently logged in user. The address is used as the default return address.

Responses

200 OK

Success!

Body
Object
userID
string
Example:
450
name
string

From the return address.

Example:
Ronny Gold
email
string
company
string

From the return address.

Example:
Gold, Lewis, LLP
address1
string

From the return address.

Example:
15 E Broad St.
address2
string

From the return address.

city
string

From the return address.

Example:
Hazleton
state
string

From the return address.

Example:
PA
zip
string

From the return address.

Example:
18201
timezone
string
Example:
America/New_York
timezoneAsNumber
string

Difference from GMT

Example:
UTC/GMT -04:00
attachmentFilesMaxLimit
number
Example:
314572800
creditBalance
string
Example:
81.60
401 401

Email and password or token was not accepted.

Examples

GET http://secure.docsmit.com/api/v1/account/info HTTP/1.1 

Content-Type: application/json

$docsmit = new DocsmitAPI($email, $hashedPW, $softwareID);
$docsmit->get('/account/info');
$status = $docsmit->status();
$response = $docsmit->responseBody();

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "userID": "450",
    "name": "John User",
    "email": "[email protected]",
    "company": "John and Co.",
    "address": "10 Main St",
    "address1": "Suite 210",
    "address2": "",
    "city": "Cleveland",
    "state": "OH",
    "zip": "12345-1234",
    "softwareIDs": "12345678901234567890123456789012",
    "suspended": 1,
    "timezone": "Eastern/US",
    "attachmentFilesMaxLimit": 314572800,
    "bullpenFilesMaxLimit": 104857600,
    "creditBalance": "81.60"
}
Misc

Miscellaneous endpoints

GET /utils/multiCASS
CASS check
GET /utils/multiCASS

CASS validate and correct an address

Request body

Object
addresses
Array
Object
firstName
string
lastName
string
address1
string
address2
string
city
string
state
string
zip
string

Responses

200 OK

Returns the corrected version (or original, if there were no corrections). If address is bad and cannot be fixed, then nonMailable is returned true.

Body
Object
addresses
Array
Object
name
string

Contains first and last together (can ignore)

address1
string
address2
string
city
string
state
string
zip
string
coarseCorrectionMsg
string

A description of what correction was made

nonMailable
string

indicates if the request and response are invalid and cannot be mailed to

Data Types and Responses
physicalParties

A number of methods, such as /messages/new and /messages/{messageID}/party use the physicalParties type. It holds one or more recipiends of physical/snail mail to be added to a mailing.

The physicalParties type is an array of the MailAddress type - that is, it’s a list of recipients.

MailAddressCreator

A mailAddressCreator holds information about one mailpiece being added. It includes the name company and address of the mail recipient and how the mailpiece is being sent to that recipient. When a mailAddress is added to a message, such as by /messages/new, it is given a MailAddressID.

Object
firstName
string

There must be either an organization or a firstName and lastName.

Example:
John
lastName
string

There must be either an organization or a firstName and lastName.

Example:
Backham
organization
string

There must be either an organization or a firstName and lastName.

Example:
abc & co.
address1
string
Example:
50 Journal Square, 8th Fl
address2
string

(optional) The second line of address.

Example:
8th Floor
city
string
Example:
Jersey City
state
string

Two digit US state abbreviation

Pattern: cc
Example:
NJ
postalCode
string
Pattern: nnnnn or nnnnn-nnnn
Example:
07306 or 07306-1234
sendType
string
Enumeration:
First Class
Certified, Electronic Return Receipt
Certified, Return Receipt
Certified
Priority Mail
Priority Mail with Signature
Priority Mail, Flat Rate Env
envelope
string
Enumeration:
#10

#10 Envelope (for First Class or Certified)

Flat

Flat Envelope (for First Class or Certified)

Priority Flat

Priority Flat Rate Envelope Letter sized

Priority Padded

Priority Flat Rate Envelope Letter sized

sided
string

(optional: default is single sided) single sided or double sided

Enumeration:
1

Single Sided

2

Double Sided

plusRegular
string

(Optional. Default = 0) This indicates that a copy is also to be sent out by first class mail in addition to the method specified in sendType. If sendType is “First Class”, plusRegular is ignored (because it is already going out First Class). Permitted values: 1 or 0 or true or false.

Enumeration:
0
1
MailAddressStatus

A mailAddressStatus holds information about one sent mailpiece. It includes the name, company and address of the mail recipient, how the mailpiece was sent to the recipient and the production and delivery status.

Object
firstName
string

There must be either an organization or a firstName and lastName.

Example:
John
lastName
string

There must be either an organization or a firstName and lastName.

Example:
Backham
organization
string

There must be either an organization or a firstName and lastName.

Example:
ABC & Co.
address1
string
Example:
50 Journal Square, 8th Fl
address2
string

(optional) The second line of address.

Example:
8th Floor
city
string
Example:
Jersey City
state
string

Two digit US state abbreviation

Pattern: cc
Example:
NJ
postalCode
string
Pattern: nnnnn or nnnnn-nnnn
Example:
07306 or 07306-1234
sendType
string
Enumeration:
First Class
Certified, Electronic Return Receipt
Certified, Return Receipt
Certified
Priority Mail
Priority Mail with Signature
Priority Mail, Flat Rate Env
envelope
string
Enumeration:
#10

#10 Envelope (for First Class or Certified)

Flat

Flat Envelope (for First Class or one of the Certified types)

Priority Flat

Priority Flat Rate Envelope, Letter sized

Priority Padded

Padded Priority Flat Rate Envelope, Letter sized

sided
string

(optional: default is single sided) single sided or double sided

Enumeration:
1

Single Sided

2

Double Sided

plusRegular
string

(Optional. Default = 0) This indicates that a copy is also to be sent out by first class mail in addition to the method specified in sendType. If sendType is “First Class”, plusRegular is ignored (because it is already going out First Class). Permitted values: 1 or 0 or true or false.

Enumeration:
0
1
USPSTrackingID
string

The Tracking ID issued by USPS for any of the Certified or Priority sendtypes.

DeliveryStatus
string

The delivery status as reported by the USPS

DStatusao
string

The delivery status “as of” time (in UTC).

400 400

Problem with one of the request parameters.

403 403 - Unauthorized Access

User does not have authority to perform this action on this messageID.