Docsmit.com
Base URI
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:
- Have a Docsmit account. (Sign Up at www.docsmit.com)
- Obtain a SoftwareID from [email protected]
Production Endpoint: https://secure.docsmit.com/api/v1
Examples in this documentation show the API in practice.
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
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.
- /messages/new Use this to upload your list of recipients in physicalParties and create the new message. Retain the MessageID that it returns.
- /messages/{messageID}/upload Use this to upload your PDF to your messaged.
- /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.
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.
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.
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
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.
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:
- “signedFor” : “https://www.example.com/docsmit/signedFor/{messageID}” or
- “signedFor” : “https://www.example.com/docsmit/signedFor.php?msgID={messageID}”
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.
-
signedFor: https://secure.docsmit.com/api/v1/testing/signedFor
-
signedFor: https://secure.docsmit.com/api/v1/testing/signedFor/{messageID}
-
signedFor: https://secure.docsmit.com/api/v1/testing/signedFor?msgID={messageID}
-
delivered: https://secure.docsmit.com/api/v1/testing/delivered
-
delivered: https://secure.docsmit.com/api/v1/testing/delivered/{messageID}
-
delivered: https://secure.docsmit.com/api/v1/testing/delivered?msgID={messageID}
-
bounced: https://secure.docsmit.com/api/v1/testing/bounced/{messageID}
-
bounced: https://secure.docsmit.com/api/v1/testing/bounced?msgID={messageID}
-
complained: https://secure.docsmit.com/api/v1/testing/complained
-
complained: https://secure.docsmit.com/api/v1/testing/complained/{messageID}
-
complained: https://secure.docsmit.com/api/v1/testing/complained?msgID={messageID}
-
reminderSent: https://secure.docsmit.com/api/v1/testing/reminderSent
-
reminderSent: https://secure.docsmit.com/api/v1/testing/reminderSent/{messageID}
-
reminderSent: https://secure.docsmit.com/api/v1/testing/reminderSent?msgID={messageID}
See the examples for usage.
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, 403returnedError()
- true if status >= 400returnedSuccess()
- 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.
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.
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).
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.
Handles temporary access tokens.
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
Example:
POST /token {
"email" : "[email protected]",
"password" : "0ce71cec25e7e01fc96cb6a43c7a5428a27991dcc311ce5544b45589a956d820b70d6d84a2d9b37cbce39d193fe3e3973c69c6f67bf99613e87f400cbde23826",
"softwareID" : "1d1337900b318d011bf64aee747b442d"
}
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.
user’s password, hashed with sha512 and encoded as a hex string. DO NOT send password by cleartext.
email address of the user
Responses
Body
Deletes the token, revoking its ability to authenticate.
Request body
16 bytes in base16 (0-F). This indicates which software is attempting to access the API. (See POST /token)
Responses
Either “Token deleted.” or “Token not found.”
Needs SoftwareID
{messageID}
/upload{messageID}
/send{messageID}
/party{messageID}
/party/{partyID}
{messageID}
/party/{partyID}
{messageID}
/priceCheckCreate 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.
This is not shown to the recipient and can only be viewed by the sender.
physicalParties is an array of MailAddressCreator, that is a list of mail recipients and how they are being sent the mail.
Return address name.
Return address organization.
Return address address1
Return address address2
Return address city
Return address state
Return address zip. This can be either a 5 digit zip or a 9 digit zip+4.
(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.
(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.
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.
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.
a client suppled clientMsgID that can later be used to lookup the message.
Responses
Success. Returns messageID
with new message number.
Body
The MessageID of the new message.
Problem with one of the request parameters.
User does not have authority to perform this action on this message.
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"
}
{messageID}
/uploadUploads 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
Request body
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" } ] }
{messageID}
/sendSends 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
Responses
Message has been sent successfully.
Body
Docsmit Message ID
The ClientMsgID of the sent message
Send failed due to inadequate funds. The amount needed is returned in the JSON as shortfall
.
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
}
{messageID}
/partyThis API call allows you to add one or more recipients by providing them in the physicalParties data type.
Path variables
Request body
physicalParties is an array of MailAddresses, that is a list of mail recipients and how they are being sent the mail.
Responses
The party has been added.
Body
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"
}
]
{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
Responses
Body
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
}
{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
Request parameters
Updates firstName
field.
Updates lastName
field.
Updates organization
field.
Updates address1
field.
Updates address2
field.
Updates city
field.
Updates state
field.
Updates postalCode
field
(DON’T USE - we only send within the US) Updates countryNonUS
field
10
Responses
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
{messageID}
/priceCheckPath variables
Request parameters
Set Months for 1,3 & 7 Year
Responses
Returns information about netPrice and detail.
Body
Invalid MessageID,certify,months,sendType parameters.
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"
}
}
Resources for getting data about a message or setting some data after it was sent.
{messageID}
{messageID}
/documentation{messageId}
/parties{messageID}
/attachments{messageID}
/transactions{messageId}
/download/{fileId}
{messageID}
/download/{ZipID}
{messageID}
Returns information about the message including recipients, its contents (or pointers to contents for some parts) and its status.
Path variables
Responses
Returns message body, title, list of attachments, recipients (with statuses), sent Status/time
Body
MessageID
The sender of the Message
Message Title
Recipient Email
If true then message is unread by the Recipient.
The Message signedFor Date.
If true, Message has atatchments.
If true, Message is certified.
Message Attachment size.
Message Transaction status with p,c,f,a
If true, Message is bookmarked.
If true then,Message is Flagged
If true, Message is set as DeliverAfter
If true, Message is sent.
If true, recipients can’t see other recipients information.
Total Recipients of the Message.
Total Unsigned Message count.
If True, Message is encrypted.
Returns Message Last Sent Type
If Message sent as SR then returns SR sent DateTime
If Message sent as NSR then returns NSR sent DateTime
DateTime of SRDeliverAfter.
DateTime of NSRDeliverAfter.
Messages Tag List
Current Time in UTC.
If true, Message is bounced.
Total Bounced parties count.
Total initialbounced parties count.
Total Reminder Bounced parties count.
Party ID
Party UserId for the Message.
Party email Address
Name of the Party.
Company Name of the company.
If true, party is sender otherwise user is message Recipients.
If true, Party is owner of the Message.
If true, Party can edit the Message.
Message Timeout DateTime.
Total count of the Message view.
Message Firstview DateTime.
Message LastView DateTime
If true, Message is SignedFor
DateTime of the Message signedFor.
Message Reminder dates.
SMTP Response of the message delivery.
Timestamp of the Message delivery.
If message has Zip then returns Total Zip download count.
Party is added After Message sent.
The emailaddress of the party addedBy
Date of the MessageSent.
If true, Message is bounced.
If true, Party is initial bounced.
If true, Party is Reminder bounced.
The dateTime of the Bounced Timestamp.
The Diagnostic code for the bounced message.
Action for the Bounced message.
if true, Party can remind.
The dateTime of the Next Reminder.
Content not found.
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."
}
{messageID}
/documentationA 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
Message Id
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
{messageId}
/partiesGet data about the Message and the Recipents.
Path variables
The Message ID number
Responses
Body
Party Id
Name in the return address
Organization/Company in the return address
First address line in return address
Second address line in return address (optional)
City in return address
State in return address
Zip in return address. May be in either 5 digit or Zip+4 format
The date and time it was accepted by Docsmit for sending. (i.e. after the user requested it be sent)
Indicates it was accepted by Docsmit. (i.e. the “accepted” field is not zeroes)
Contains an array of #MailAddressStatus
Invalid MessageId supplied. For example, if the message ID provided is not an integer.
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": ""
}
{messageID}
/attachmentsReturn the information about the message attachments including id, fileId, fileName, size, attachmentId.
Path variables
Responses
Body
Invalid MessageID supplied.
Body
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"
}
]
{messageID}
/transactionsReturns all financial transactions for the Message.
Path variables
Request parameters
2951
Transactions can be filtered using recipientID
.
Transactions can be filter using to
date.
Transactions can be filter using from
date.
Responses
Returns the information about Transaction history for the particular message.
Body
Invalid MessageID supplied.
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"
}
]
}
]
{messageId}
/download/{fileId}
Path variables
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();
Deals with purchased credit.
Get the list of messages that have been sent.
Request parameters
Sent messages can be filtered using clientMsgID
param. It will return all the sent messages which match exactly the specified clientMsgID
.
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
.
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.
Sent message can be filter using recipient. It will return all the sent messages where the string exactly matches a recipeint.
A list of comma separated values. If this is included messages with exactly matching MessageIDs will be returned.
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.
Responses
Everything worked as expected
Body
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"
}
}
Get the list of unsent (draft) messages.
Request parameters
Draft messages can be filtered using clientMsgID
.
By default draft messages are filtered using softwareID
. To turn of this filter use turnOffSoftwareID
param.
Draft messages can be filter using clientMsgID_MR
param. This parameter accepts MySQL REGEX. It will list all the messages which matches specified regex.
Draft messages can be filter using messageIDList
param. It will return all the draft messages filter using messageIDList
.
Draft messages can be filter using clientMsgIDList
param. It will return all the draft messages filter using clientMsgIDList
.
Responses
Body
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"
}
]
Returns information about the currently logged in user. The address is used as the default return address.
Responses
Success!
Body
From the return address.
From the return address.
From the return address.
From the return address.
From the return address.
From the return address.
From the return address.
Difference from GMT
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"
}
Miscellaneous endpoints
CASS validate and correct an address
Request body
Responses
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
Contains first and last together (can ignore)
A description of what correction was made
indicates if the request and response are invalid and cannot be mailed to
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.
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.
There must be either an organization or a firstName and lastName.
There must be either an organization or a firstName and lastName.
There must be either an organization or a firstName and lastName.
(optional) The second line of address.
Two digit US state abbreviation
#10 Envelope (for First Class or Certified)
Flat Envelope (for First Class or Certified)
Priority Flat Rate Envelope Letter sized
Priority Flat Rate Envelope Letter sized
(optional: default is single sided) single sided or double sided
Single Sided
Double Sided
(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.
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.
There must be either an organization or a firstName and lastName.
There must be either an organization or a firstName and lastName.
There must be either an organization or a firstName and lastName.
(optional) The second line of address.
Two digit US state abbreviation
#10 Envelope (for First Class or Certified)
Flat Envelope (for First Class or one of the Certified types)
Priority Flat Rate Envelope, Letter sized
Padded Priority Flat Rate Envelope, Letter sized
(optional: default is single sided) single sided or double sided
Single Sided
Double Sided
(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.
The Tracking ID issued by USPS for any of the Certified or Priority sendtypes.
The delivery status as reported by the USPS
The delivery status “as of” time (in UTC).
Problem with one of the request parameters.
Email and password or token was not accepted.
Body
User does not have authority to perform this action on this messageID.