Helper Libraries & SDKs

DataMotion's DMWeb Library makes it easy to integrate DataMotion into your own applications.


Download our officially supported libraries here

Download our officially supported Postman collections here





Don't see your language above? Check back soon! We're always adding new libraries.

Admin API

The Admin API uses session keys for authentication, which you can get from a commonly accessed DataMotion web method to  Get A Session Key. This SessionKey can then be used in every DataMotion API that uses session keys; not just the Admin API.

Note: Some Admin API methods cannot be used on the DataMotion Direct platform.

Authentication

The following methods handle authentication to the DataMotion SecureMail Administration API

box icon

GET A SESSION KEY

The GetSessionKey method accepts an encrypted payload, which adds a security layer to existing SSL protocols. This method can also be used to enable "Single Sign On" without transmitting the user's password.

Note: When we refer to “Single Sign On,” it does not signify an industry-standard SSO feature, but rather a set of API capabilities that enable an application program to implement SSO, and so it is used as a short-hand way of referring to these API capabilities.

Code Snippets

C# v2

Admin_API_SDK.DMAdmin admin = new Admin_API_SDK.DMAdmin("https://ssl.datamotion.com");

string sessionKey = admin.Authentication.GetSessionKey("encryptionKey", "email", "automationID").GetAwaiter().GetResult();

C# v1.0.3

DMWebLib.Admin AdminLib = new DMWebLib.Admin("https://ssl.datamotion.com", "ABCDE12345", "12345ABCDE");
DMWebLib.Models.Admin.IdentityModel AdminIdentityModel = new DMWebLib.Models.Admin.IdentityModel { Email = "example@email.com", SingleSignOnId = "SSO123" };
DMWebLib.Models.Admin.LoginModel AdminLoginModel = new DMWebLib.Models.Admin.LoginModel { Identity = AdminIdentityModel, TimeStamp = DateTime.Now};

string sessionKey = AdminLib.GetSessionKey(AdminLoginModel);
box icon

GET AN ENCRYPTION KEY (PSK)

This method returns a user's encryption key, or Pre-Shared Key.

Note: If a user's encryption key does not already exist, a new one will be generated.

Code Snippets

C#

DMWebLib.Admin AdminLib = new DMWebLib.Admin("https://ssl.datamotion.com", "ABCDE12345", "12345ABCDE");
DMWebLib.Models.Admin.IdentityModel AdminIdentityModel = new DMWebLib.Models.Admin.IdentityModel { Email = "example@email.com", SingleSignOnId = "SSO123" };

string encryptionKey = AdminLib.GetEncryptionKey(sessionKey, AdminIdentityModel);
box icon

CREATE A NEW ENCRYPTION KEY (PSK)

This method generates and returns a new company encryption key, invalidating any existing key.

Code Snippets

C#

DMWebLib.Admin AdminLib = new DMWebLib.Admin("https://ssl.datamotion.com", "ABCDE12345", "12345ABCDE");
DMWebLib.Models.Admin.IdentityModel AdminIdentityModel = new DMWebLib.Models.Admin.IdentityModel { Email = "example@email.com", SingleSignOnId = "SSO123" };

string encryptionKey = AdminLib.NewEncryptionKey(sessionKey, AdminIdentityModel);

Account

These methods are used to perform basic account administration tasks, like viewing users and their privileges.

box icon

LIST USER ACCOUNTS

This method lists company user accounts

Code Snippets

C# v2


Admin_API_SDK.DMAdmin admin = new Admin_API_SDK.DMAdmin("https://ssl.datamotion.com");

Admin_API_SDK.Models.Account.ListUserAccountsRequest request = new Admin_API_SDK.Models.Account.ListUserAccountsRequest();
request.UserTypeId = 12345;
request.PageNumber = 1;
request.CompanyId = 0.ToString();
request.OrderBy = "UniqueId";
request.Filter = "";

Admin_API_SDK.Models.Account.ListUserAccountsResponse response = new Admin_API_SDK.Models.Account.ListUserAccountsResponse();

response = admin.Account.ListUserAccounts(request).GetAwaiter().GetResult();

C# v1.0.3

DMWebLib.Admin AdminLib = new DMWebLib.Admin("https://ssl.datamotion.com", "ABCDE12345", "12345ABCDE");
DMWebLib.Models.Admin.AccountListModel AdminAccountListModel = new DMWebLib.Models.Admin.AccountListModel();

DMWebLib.Models.Admin.AccountIndexRequestModel AdminAccountIndexRequestModel = new DMWebLib.Models.Admin.AccountIndexRequestModel { CompanyId = 12345, UserTypeId = 1 };

AdminAccountListModel = AdminLib.List(sessionKey, AdminAccountIndexRequestModel);
box icon

CREATE A USER ACCOUNT

This method creates a company user account.

Code Snippets

C# v2


Admin_API_SDK.DMAdmin admin = new Admin_API_SDK.DMAdmin("https://ssl.datamotion.com");

Admin_API_SDK.Models.Account.CreateUserRequest request = new Admin_API_SDK.Models.Account.CreateUserRequest();
request.Email = "jane@example.com";
request.UserId = "janetheadmin";
request.SingleSignOnId = "ExampleJane";
request.Password = "|?|Y||p@$5|//0rd";
request.FirstName = "Jane";
request.LastName = "Doe";
request.Phone = "8675309";
request.CompanyId = 112;
request.EmployeeId = "1564872";
request.Miscellaneous = "";
request.Disabled = false;
request.UserTypeId = 252;
request.ReceiveOffers = false;

Admin_API_SDK.Models.Account.CreateUserResponse response = new Admin_API_SDK.Models.Account.CreateUserResponse();
response = admin.Account.CreateUserAccount(request).GetAwaiter().GetResult();

C# v1.0.3

DMWebLib.Admin AdminLib = new DMWebLib.Admin("https://ssl.datamotion.com", "ABCDE12345", "12345ABCDE");
DMWebLib.Models.Admin.AccountModel AdminAccountModel = new DMWebLib.Models.Admin.AccountModel { ButtonUser = false, CompanyId = 12345, Disabled = false, Email = "example@email.com", FirstName = "John", LastName = "Doe", SingleSignOnId = "SSOID123", UserId = "JohnDoe", UserTypeId = 1};
DMWebLib.Models.Admin.AccountModel AdminAccountResponseModel = new DMWebLib.Models.Admin.AccountModel();

AdminAccountResponseModel = AdminLib.Create(sessionKey, AdminAccountModel);
box icon

VIEW A USER ACCOUNT

This method retrieves a company user account, overwriting all existing values.

Code Snippets

C# v2


Admin_API_SDK.DMAdmin admin = new Admin_API_SDK.DMAdmin("https://ssl.datamotion.com");

Admin_API_SDK.Models.Account.ViewUserRequest request = new Admin_API_SDK.Models.Account.ViewUserRequest();
request.UID = 11597;
request.Email = "jane@example.com";
request.UserId = "janetheadmin";
request.SingleSignOnId = "ExampleJane";

Admin_API_SDK.Models.Account.ViewUserResponse response = new Admin_API_SDK.Models.Account.ViewUserResponse();
response = admin.Account.ViewUserAccount(request).GetAwaiter().GetResult();                     

C# v1.0.3

DMWebLib.Admin AdminLib = new DMWebLib.Admin("https://ssl.datamotion.com", "ABCDE12345", "12345ABCDE");
DMWebLib.Models.Admin.IdentityModel AdminIdentityModel = new DMWebLib.Models.Admin.IdentityModel { Email = "email@example.com", SingleSignOnId = "SSOID123", UserId = "JohnDoe" };
DMWebLib.Models.Admin.AccountModel AdminAccountResponseModel = new DMWebLib.Models.Admin.AccountModel();

AdminAccountResponseModel = AdminLib.Read(sessionKey, AdminIdentityModel);
box icon

UPDATE A USER ACCOUNT

This method updates a company user account, overwriting all existing values.

Note:  Any request body parameters left blank/null (except the password), will be stored in the user account as blank/null.

Code Snippets

C# v2


Admin_API_SDK.DMAdmin admin = new Admin_API_SDK.DMAdmin("https://ssl.datamotion.com");

Admin_API_SDK.Models.Account.UpdateUserRequest request = new Admin_API_SDK.Models.Account.UpdateUserRequest();
request.UniqueId = 11597;
request.Email = "jane@example.com";
request.UserId = "janetheadmin";
request.SingleSignOnId = "ExampleJane";
request.Password = "|?|Y||p@$5|//0rd";
request.FirstName = "Jane";
request.LastName = "Doe";
request.Phone = "8675309";
request.CompanyId = 112;
request.EmployeeId = "1564872";
request.Miscellaneous = "";
request.Disabled = false;
request.UserTypeId = 252;
request.ReceiveOffers = false;

Admin_API_SDK.Models.Account.UpdateUserResponse response = new Admin_API_SDK.Models.Account.UpdateUserResponse();
response = admin.Account.UpdateUserAccount(request).GetAwaiter().GetResult();                                

C# v1.0.3

DMWebLib.Admin AdminLib = new DMWebLib.Admin("https://ssl.datamotion.com", "ABCDE12345", "12345ABCDE");
DMWebLib.Models.Admin.AccountModel AdminAccountModel = new DMWebLib.Models.Admin.AccountModel { ButtonUser = false, CompanyId = 12345, Disabled = false, Email = "example@email.com", FirstName = "John", LastName = "Doe", SingleSignOnId = "SSOID123", UserId = "JohnDoe", UserTypeId = 1 };
DMWebLib.Models.Admin.AccountModel AdminAccountResponseModel = new DMWebLib.Models.Admin.AccountModel();

AdminAccountResponseModel = AdminLib.Update(sessionKey, AdminAccountModel);
box icon

DELETE A USER ACCOUNT

This method deletes a company user account

Code Snippets

C# v2


Admin_API_SDK.DMAdmin admin = new Admin_API_SDK.DMAdmin("https://ssl.datamotion.com");

Admin_API_SDK.Models.Account.DeleteUserRequest request = new Admin_API_SDK.Models.Account.DeleteUserRequest();
request.UID = 11597;
request.Email = "jane@example.com";
request.UserId = "janetheadmin";
request.SingleSignOnId = "ExampleJane";

admin.Account.DeleteUser(request);

C# v1.0.3

DMWebLib.Admin AdminLib = new DMWebLib.Admin("https://ssl.datamotion.com", "ABCDE12345", "12345ABCDE");
DMWebLib.Models.Admin.IdentityModel AdminIdentityModel = new DMWebLib.Models.Admin.IdentityModel { Email = "email@example.com", SingleSignOnId = "SSOID123", UserId = "JohnDoe" };

AdminLib.Read(sessionKey, AdminIdentityModel);
box icon

GET USERTYPES

This method provides a list of UserTypes that have been provisioned for a company

Code Snippets

C# v2


Admin_API_SDK.DMAdmin admin = new Admin_API_SDK.DMAdmin("https://ssl.datamotion.com");

List response = new List();

response = admin.Account.GetUserTypes().GetAwaiter().GetResult();

C# v1.0.3

DMWebLib.Admin AdminLib = new DMWebLib.Admin("https://ssl.datamotion.com", "ABCDE12345", "12345ABCDE");
DMWebLib.Models.Admin.UserTypeModel AdminUserTypeResponseModel
List<DMWebLib.Models.Admin.UserTypeModel> AdminUserTypes = new List<DMWebLib.Models.Admin.UserTypeModel>();

AdminUserTypes = AdminLib.GetUserTypes(sessionKey);

Gateway

The Gateway API Methods provide the following capabilities:

  • Obtain company-level credentials to authenticate SMTP access for sending emails to the DataMotion SMTP Gateway.
  • Create and maintain a whitelist of IP addresses that are permitted to send emails to the DataMotion SMTP Gateway.
  • Deliver plain text SMTP messages with TLS routing from the DataMotion SMTP Gateway.

box icon

GET COMPANY SMTP CREDENTIALS

This method returns the credentials (Company UserID and Company Password) to access the DataMotion Gateway on a company authorized level.

Code Snippets

C# v2


Admin_API_SDK.DMAdmin admin = new Admin_API_SDK.DMAdmin("https://ssl.datamotion.com");

Admin_API_SDK.Models.SMTP_Gateway.SMTPCredentialsResponse response = new Admin_API_SDK.Models.SMTP_Gateway.SMTPCredentialsResponse();

response = admin.SMTPGateway.GetCompanySMTPCredentials().GetAwaiter().GetResult();

C# v1.0.3

DMWebLib.Admin AdminLib = new DMWebLib.Admin("https://ssl.datamotion.com", "ABCDE12345", "12345ABCDE");
DMWebLib.Models.Admin.SMTPCredentialsModel SMTPCredentialsResponseModel = new DMWebLib.Models.Admin.SMTPCredentialsModel();

SMTPCredentialsResponseModel = AdminLib.GetCredentials(sessionKey);
box icon

RESET PASSWORD

This method generates a new password to be used in SMTP authentication.

Code Snippets

C# v2

admin = new Admin_API_SDK.DMAdmin("https://ssl.datamotion.com");response = new Admin_API_SDK.Models.SMTP_Gateway.ResetPasswordResponse();= admin.SMTPGateway.ResetPassword().GetAwaiter().GetResult();

C# v1.0.3

DMWebLib.Admin AdminLib = new DMWebLib.Admin("https://ssl.datamotion.com", "ABCDE12345", "12345ABCDE");
DMWebLib.Models.Admin.SMTPCredentialsModel SMTPCredentialsResponseModel = new DMWebLib.Models.Admin.SMTPCredentialsModel();

SMTPCredentialsResponseModel = AdminLib.ResetPassword(sessionKey);
box icon

UPDATE IP WHITELIST

This method provides the ability to establish an exclusive whitelist of approved IP addresses associated with the company that are allowed to connect to the DataMotion SMTP Gateway for sending emails (any existing SMTP Credentials will be overwritten). It also provides the ability to deliver plain text SMTP messages with TLS routing from the DataMotion SMTP Gateway.

Note:  To remove an existing whitelist, simply pass an emptry string in the request body.

Code Snippets

C#

DMWebLib.Admin AdminLib = new DMWebLib.Admin("https://ssl.datamotion.com", "ABCDE12345", "12345ABCDE");
DMWebLib.Models.Admin.SMTPEndpoint2Model[] SMTPEndpoint2Model = new DMWebLib.Models.Admin.SMTPEndpoint2Model[1];
SMTPEndpoint2Model[0] = new DMWebLib.Models.Admin.SMTPEndpoint2Model { Domain = "www.domain.com", Incoming = true, IpAddress = "12.12.12.12", Outgoing = true, Port = 25, Subnet = "255.255.255.0" };
DMWebLib.Models.Admin.SMTPCredentialsModel SMTPCredentialsResponseModel = new DMWebLib.Models.Admin.SMTPCredentialsModel();

SMTPCredentialsResponseModel = AdminLib.PutSMTPEndpoints(sessionKey, SMTPEndpoint2Model);

More Information

box icon

SSO USING HTTP HEADERS

Using the following mashup method to integrate DataMotion SecureMail web portal features with an application program. This allows developers to access DataMotion SecureMail web portal features programmatically using Single Sign-On.

NOTE: When this documentation refers to "Single Sign On", it does not signify an industry-standard SSO feature, but rather a set of API capabilities that enable an application program to implement SSO, and so it is used as a short-hand way of referring to these API capabilities.

This method is typically used to access administration features, such as Reporting and Cobrand Management. These administration tools can be accessed only with DataMotion SecureMail administrator or company credentials.

To access the administration features programatically, you must first obtain a Session Key using the  GetSessionKey API method. After a Session Key has been acquired, you can access the administration features simply by adding the Session Key as a header in the HTTP request. (See the X-Session-Key header in the following example.)

Example

REST


GET https://ssl.datamotion.com/admin/default.aspx HTTP/1.1
Host: ssl.datamotion.com
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36
DNT: 1
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Cookie: ASP.NET_SessionId=b0bkzageut4zksoro4wrxsmc
X-Session-Key: 203D215C5CEF40D48BDC607AC6FAD735

Messaging API

The DataMotion Messaging API facilitates all message handling with various methods for sending, receiving and manipulating a user’s inbox.


Note: For versions of SecureMail v5.36 and earlier or Direct v6.2 and earlier, we've also included the original SOAP-based calls for which the DMWeb library is written over.

Account

The following methods handle authentication to the DataMotion Secure Messaging Service as well as basic account functions.

box icon

GET A SESSION KEY

This method is used to authenticate DataMotion credentials and retrieve a SessionKey. Unless otherwise noted, this method must be called before any any other web service function, as the X-Session-Key header value is required to call most methods.

Code Snippets

C# v2

DMWeb_REST.DMWeb dmweb = new DMWeb_REST.DMWeb("https://ssl.datamotion.com/SecureMessagingAPI");

Messaging_Library.Models.AccountModels.LogOn user = new Messaging_Library.Models.AccountModels.LogOn();
user.UserIdOrEmail = "username";
user.Password = "password";

string sessionKey = dmweb.Account.LogOn(user).GetAwaiter().GetResult();

C# v1.0.3

DMWebLib.Messaging MessagingLib = new DMWebLib.Messaging("https://ssl.datamotion.com/CMv4/CMv4.asmx");
string sessionkey = MessagingLib.Logon("username", "password");

SOAP

POST /cmv4/cmv4.asmx HTTP/1.1
Host: ssl.datamotion.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://ssl.datamotion.com/CMv4/Logon"

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance">
    <soap:Body>
        <Logon xmlns="https://ssl.datamotion.com/CMv4">
            <UserIDorEmail>string</UserIDorEmail>
            <Password>string</Password>
        </Logon>
    </soap:Body>
</soap:Envelope>



HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance">
    <soap:Body>
        <LogonResponse xmlns="https://ssl.datamotion.com/CMv4">
            <LogonResult>string</LogonResult>
        </LogonResponse>
    </soap:Body>
</soap:Envelope>
box icon

GET YOUR ACCOUNT DETAILS

This method is used to query account information about the user.

Code Snippets

C# v2

DMWeb_REST.DMWeb dmweb = new DMWeb_REST.DMWeb("https://ssl.datamotion.com/SecureMessagingAPI");

Messaging_Library.Models.AccountModels.AccountDetails accountDetails = new Messaging_Library.Models.AccountModels.AccountDetails();
accountdetails = dmweb.Account.Details().GetAwaiter().GetResult();

C# v1.0.3

DMWebLib.Messaging MessagingLib = new DMWebLib.Messaging("https://ssl.datamotion.com/CMv4/CMv4.asmx");
DMWebLib.AccountDetails accountDetails = MessagingLib.GetAccountDetails(sessionkey);

SOAP

POST /cmv4/cmv4.asmx HTTP/1.1
Host: ssl.datamotion.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://ssl.datamotion.com/CMv4/GetAccountDetails"

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance">
    <soap:Body>
        <GetAccountDetails xmlns="https://ssl.datamotion.com/CMv4">
            <SessionKey>string</SessionKey>
        </GetAccountDetails>
    </soap:Body>
</soap:Envelope>



HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance">
    <soap:Body>
        <GetAccountDetailsResponse xmlns="https://ssl.datamotion.com/CMv4">
            <GetAccountDetailsResult>string</GetAccountDetailsResult>
        </GetAccountDetailsResponse>
    </soap:Body>
</soap:Envelope>
box icon

CHANGE YOUR PASSWORD

This method is used to change a DataMotion account’s password information. This routine accepts valid DataMotion account credentials and does not require a call to the Logon function to obtain a SessionKey parameter. As such, ChangePassword allows an account password to be changed even if the account’s password has expired.

Code Snippets

C# v2


DMWeb_REST.DMWeb dmweb = new DMWeb_REST.DMWeb("https://ssl.datamotion.com/SecureMessagingAPI");

Messaging_Library.Models.AccountModels.ChangePassword changePassword = new Messaging_Library.Models.AccountModels.ChangePassword();
changePassword.OldPassword = "OldPassword";
changePassword.NewPassword = "NewPassword";

string response = dmweb.Account.ChangePassword(changePassword).GetAwaiter().GetResult();

C# v1.0.3


DMWebLib.Messaging MessagingLib = new DMWebLib.Messaging("https://ssl.datamotion.com/CMv4/CMv4.asmx");
MessagingLib.ChangePassword("username", "password1", "password");

SOAP


POST /cmv4/cmv4.asmx HTTP/1.1
Host: ssl.datamotion.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://ssl.datamotion.com/CMv4/ChangePassword"

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance">
    <soap:Body>
        <ChangePassword xmlns="https://ssl.datamotion.com/CMv4">
            <EmailAddr>string</EmailAddr>
            <NewPassword>string</NewPassword>
            <OldPassword>string</OldPassword>
        </ChangePassword>
    </soap:Body>
</soap:Envelope>
box icon

LOGOUT

This method is used to invalidate a SessionKey, making any subsequent calls with that SessionKey invalid.

Code Snippets

C# v2

DMWeb_REST.DMWeb dmweb = new DMWeb_REST.DMWeb("https://ssl.datamotion.com/SecureMessagingAPI");

string response = dmweb.Account.LogOut().GetAwaiter().GetResult();

C# v1.0.3

DMWebLib.Messaging MessagingLib = new DMWebLib.Messaging("https://ssl.datamotion.com/CMv4/CMv4.asmx");
MessagingLib.Logout(sessionkey);

SOAP

POST /cmv4/cmv4.asmx HTTP/1.1
Host: ssl.datamotion.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://ssl.datamotion.com/CMv4/Logout"

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance">
    <soap:Body>
        <Logout xmlns="https://ssl.datamotion.com/CMv4">
            <SessionKey>string</SessionKey>
        </Logout>
    </soap:Body>
</soap:Envelope>

Folder

The following methods describe folder actions.

box icon

LIST ALL FOLDERS

This method is used to retrieve a list of the user’s folders and corresponding statistics.

Code Snippets

C# v2


DMWeb_REST.DMWeb dmweb = new DMWeb_REST.DMWeb("https://ssl.datamotion.com/SecureMessagingAPI");

Messaging_Library.Models.FolderModels.Folder listFolders = new Messaging_Library.Models.FolderModels.Folder();
listFolders = dmweb.Folder.List().GetAwaiter().GetResult()

C# v1.0.3


DMWebLib.Messaging MessagingLib = new DMWebLib.Messaging("https://ssl.datamotion.com/CMv4/CMv4.asmx");
List<DMwebLib.Messaging.Folder> folders = new List<DMwebLib.Messaging.Folder>(); //Initialize a new folder struct
folders = MessagingLib.GetFolderList(sessionkey);

SOAP


POST /cmv4/cmv4.asmx HTTP/1.1
Host: ssl.datamotion.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://ssl.datamotion.com/CMv4/GetFolderList"

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance">
    <soap:Body>
        <GetFolderList xmlns="https://ssl.datamotion.com/CMv4">
            <SessionKey>string</SessionKey>
        </GetFolderList>
    </soap:Body>
</soap:Envelope>


HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance">
    <soap:Body>
        <GetFolderListResponse xmlns="https://ssl.datamotion.com/CMv4">
            <GetFolderListResult>string</GetFolderListResult>
        </GetFolderListResponse>
    </soap:Body>
</soap:Envelope>
box icon

CREATE A NEW FOLDER

This method is used to create a custom folder in a user’s account. Once a folder is created, messages can be moved into it using the Move Message function.

Code Snippets

C# v2


DMWeb_REST.DMWeb dmweb = new DMWeb_REST.DMWeb("https://ssl.datamotion.com/SecureMessagingAPI");

Messaging_Library.Models.FolderModels.Create createFolder = new Messaging_Library.Models.FolderModels.Create();
createFolder.FolderName = "Name of Folder";
createFolder.FolderType = 0;

string createdFolder = dmweb.Folders.Create(createFolder).GetAwaiter().GetResult();

C# v1.0.3


DMWebLib.Messaging MessagingLib = new DMWebLib.Messaging("https://ssl.datamotion.com/CMv4/CMv4.asmx");
int inboxOutbox = 0;
string folderName = "new folder";
string response = MessagingLib.CreateFolder(sessionkey, inboxOutbox, folderName);

SOAP


POST /cmv4/cmv4.asmx HTTP/1.1
Host: ssl.datamotion.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://ssl.datamotion.com/CMv4/CreateFolder"

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance">
    <soap:Body>
        <CreateFolder xmlns="https://ssl.datamotion.com/CMv4">
            <SessionKey>string</SessionKey>
            <FolderType>int</FolderType>
            <FolderName>string</FolderName>
        </CreateFolder>
    </soap:Body>
</soap:Envelope>


HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance">
    <soap:Body>
        <CreateFolderResponse xmlns="https://ssl.datamotion.com/CMv4">
            <CreateFolderResult>string</CreateFolderResult>
        </CreateFolderResponse>
    </soap:Body>
</soap:Envelope>
box icon

DELETE A FOLDER

This method is used to delete a custom folder from a user’s account. Only custom folders can be deleted from a user’s account. When a folder that contains messages is deleted from the system, the messages will be moved into the respective Inbox or Outbox parent folder automatically.

Code Snippets

C# v2



DMWeb_REST.DMWeb dmweb = new DMWeb_REST.DMWeb("https://ssl.datamotion.com/SecureMessagingAPI");

string response = dmweb.Folders.Delete("FolderId").GetAwaiter().GetResult();

C# 1.0.3


DMWebLib.Messaging MessagingLib = new DMWebLib.Messaging("https://ssl.datamotion.com/CMv4/CMv4.asmx");
int FID = 1;
MessagingLib.DeleteFolder(sessionkey, FID);

SOAP


POST /cmv4/cmv4.asmx HTTP/1.1
Host: ssl.datamotion.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://ssl.datamotion.com/CMv4/DeleteFolder"

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance">
    <soap:Body>
        <DeleteFolder xmlns="https://ssl.datamotion.com/CMv4">
            <SessionKey>string</SessionKey>
            <FID>int</FID>
        </DeleteFolder>
    </soap:Body>
</soap:Envelope>

Message

The following methods handle DataMotion messages.

box icon

GET INBOX MESSAGE IDS

This method is used to retrieve the message IDs (MIDs) of all messages in the user's inbox

Code Snippets

C# v2


DMWeb_REST.DMWeb dmweb = new DMWeb_REST.DMWeb("https://ssl.datamotion.com/SecureMessagingAPI");

Messaging_Library.Models.MessagingModels.GetInboxMIDRequest midRequest = new Messaging_Library.Models.MessagingModels.GetInboxMIDRequest();
midRequest.FolderId = 1;
midRequest.MessageListFilter = 0;
midRequest.MustHaveAttachments = false;

Messaging_Library.Models.MessagingModels.GetInboxMIDResponse midResponse = dmweb.Message.GetInboxMessageIds(midRequest).GetAwaiter().GetResult();
box icon

GET MESSAGE SUMMARIES

This method is used to retrieve message summaries of all messages within a specified folder

Code Snippets

C# v2


DMWeb_REST.DMWeb dmweb = new DMWeb_REST.DMWeb("https://ssl.datamotion.com/SecureMessagingAPI");

Messaging_Library.Models.MessagingModels.GetMessageSummariesRequest summariesRequest = new Messaging_Library.Models.MessagingModels.GetMessageSummariesRequest();
summariesRequest.FolderId = 1;
summariesRequest.LastMessageIDReceived = 0;

Messaging_Library.Models.MessagingModels.GetMessageSummaries summariesResponse = dmweb.Message.GetMessageSummaries(summariesRequest).GetAwaiter().GetResult();
box icon

GET UNREAD MESSAGES

This method returns message summaries for all unread messages in the user's Inbox. Any messages that were delivered via SafeTLS (with a MessageStatus = 5) will also be returned in this method.

Code Snippets

C# v2


DMWeb_REST.DMWeb dmweb = new DMWeb_REST.DMWeb("https://ssl.datamotion.com/SecureMessagingAPI");

Messaging_Library.Models.MessagingModels.GetUnreadMessages unreadMessages = dmweb.Message.GetUnreadMessages(false, "folderId").GetAwaiter().GetResult();
box icon

SEARCH THE INBOX

This method is used to search the user's inbox, based on filter parameters

Code Snippets

C# v2


DMWeb_REST.DMWeb dmweb = new DMWeb_REST.DMWeb("https://ssl.datamotion.com/SecureMessagingAPI");

Messaging_Library.Models.MessagingModels.SearchInbox search = new Messaging_Library.Models.MessagingModels.SearchInbox();
search.Filter = "email";
search.FolderId = 1;
search.GetInboxUnReadOnly = false;
search.GetRetractedMsgs = false;
search.OrderBy = "";
search.OrderDesc = true;
search.PageNum = 1;
search.PageSize = 1;

Messaging_Library.Models.MessagingModels.SearchInboxResponse searchInbox = dmweb.Message.SearchInbox(search).GetAwaiter().GetResult();
box icon

GET MESSAGE METADATA

This method is used to retrieve metadata for a sent message, aprticularly tracking and security information

Code Snippets

C# v2


DMWeb_REST.DMWeb dmweb = new DMWeb_REST.DMWeb("https://ssl.datamotion.com/SecureMessagingAPI");

Messaging_Library.Models.MessagingModels.MetadataResponse metadata = dmweb.Message.GetMessageMetadata("123456").GetAwaiter().GetResult();
box icon

GET A MESSAGE

This method retrieves a message based on the MID passed

Code Snippets

C# v2


DMWeb_REST.DMWeb dmweb = new DMWeb_REST.DMWeb("https://ssl.datamotion.com/SecureMessagingAPI");

Messaging_Library.Models.MessagingModels.GetMessage getMessage = dmweb.Message.Get("123456").GetAwaiter().GetResult();
box icon

GET A MIME MESSAGE

This method is used to retrieve a DataMotion message in standard MIME format. Senders and recipients are the only users that have access to the message and will be permitted to retrieve basic DataMotion header information and the Security Envelope. The message sender is the only user that will be permitted to retrieve detailed tracking information. When a message is retrieved using this function, tracking information will automatically be written indicating the message was read by the recipient

Code Snippets

C# v2


DMWeb_REST.DMWeb dmweb = new DMWeb_REST.DMWeb("https://ssl.datamotion.com/SecureMessagingAPI");

Messaging_Library.Models.MessagingModels.MimeMessageRequestandResponse getmimeMessage = dmweb.Message.GetaMimeMessage("123456").GetAwaiter().GetResult();

C# v1.0.3


DMWebLib.Messaging MessagingLib = new DMWebLib.Messaging("https://ssl.datamotion.com/CMv4/CMv4.asmx");
int MID = 12345
bool withTracking = true;
bool withCMHeader = true;
bool withSecurityEnvelope = true;
string result = MessagingLib.GetMIMEMessage(sessionkey, MID, withCMHeader, withTracking, withSecurityEnvelope);

SOAP


POST /cmv4/cmv4.asmx HTTP/1.1
Host: ssl.datamotion.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://ssl.datamotion.com/CMv4/GetMIMEMessage"

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance">
    <soap:Body>
        <GetMIMEMessage xmlns="https://ssl.datamotion.com/CMv4">
            <SessionKey>string</SessionKey>
            <MID>int</MID>
            <WithCMHeaderXML>boolean</WithCMHeaderXML>
            <WithTrackingXML>boolean</WithTrackingXML>
            <WithSecurityEnvelope>boolean</WithSecurityEnvelope>
        </GetMIMEMessage>
    </soap:Body>
</soap:Envelope>


HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance">
    <soap:Body>
        <GetMIMEMessageResponse xmlns="https://ssl.datamotion.com/CMv4">
            <GetMIMEMessageResult>string</GetMIMEMessageResult>
        </GetMIMEMessageResponse>
    </soap:Body>
</soap:Envelope>
box icon

SEND A MESSAGE

This method sends a message to a given recipient(s) from the user associated with the SessionKey

Code Snippets

C# v2


DMWeb_REST.DMWeb dmweb = new DMWeb_REST.DMWeb("https://ssl.datamotion.com/SecureMessagingAPI");

Messaging_Library.Models.MessagingModels.SendMessage sendMessageRequestBody = new Messaging_Library.Models.MessagingModels.SendMessage();
sendMessageRequestBody.To.Add("Receiver's email");
sendMessageRequestBody.From = "Your email";
sendMessageRequestBody.Subject = "Subject";
sendMessageRequestBody.HtmlBody = "Message";
sendMessageRequestBody.TextBody = "Message";

int mid = dmweb.Message.Send(sendMessageRequestBody).GetAwaiter().GetResult();
box icon

SEND A MIME MESSAGE

Sends a properly formatted MIME message.

Code Snippets

C# v2


DMWeb_REST.DMWeb dmweb = new DMWeb_REST.DMWeb("https://ssl.datamotion.com/SecureMessagingAPI");

Messaging_Library.Models.MessagingModels.SendMessage sendmimemessage = new Messaging_Library.Models.MessagingModels.SendMessage();
sendmimemessage.To.Add("Receivers email");
sendmimemessage.From = "Your email";
sendmimemessage.Subject = "Subject";
sendmimemessage.HtmlBody = "Message";
sendmimemessage.TextBody = "Message";

string mid = dmweb.Message.SendMimeMessage(sendmimemessage, @"FileLocation").GetAwaiter().GetResult();

C# v1.0.3


DMWebLib.Messaging MessagingLib = new DMWebLib.Messaging("https://ssl.datamotion.com/CMv4/CMv4.asmx");
string[] To = new string[2];
string[] Cc = new string[2];
string[] Bcc = new string[2];
List<byte[]> attachmentFiles = new List<byte[]>(); //Initialize ArrayList to hold the file data
ArrayList attachmentNames = new ArrayList(); //Initialize ArrayList to hold the full file names for display purposes
string Body = "body";
string Subject = "subject";
txt_Status.Text = MessagingLib.SendMIMEMessage(sessionkey, To, Cc, Bcc, attachmentFiles, attachmentNames, txt_Body.Text, txt_Subject.Text); //Show result of SendMIMEMessage SOAP Request

SOAP


POST /cmv4/cmv4.asmx HTTP/1.1
Host: ssl.datamotion.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://ssl.datamotion.com/CMv4/SendMIMEMessage"

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance">
    <soap:Body>
        <SendMIMEMessage xmlns="https://ssl.datamotion.com/CMv4">
            <SessionKey>string</SessionKey>
            <Message>string</Message>
        </SendMIMEMessage>
    </soap:Body>
</soap:Envelope>


HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance">
    <soap:Body>
        <SendMIMEMessageResponse xmlns="https://ssl.datamotion.com/CMv4">
            <SendMIMEMessageResult>string</SendMIMEMessageResult>
        </SendMIMEMessageResponse>
    </soap:Body>
</soap:Envelope>

box icon

MOVE A MESSAGE

This method is used to move a particular message into a specific folder. Messages can only be moved within their respective type (ie: Inbox or Outbox), but they can be placed in any subfolder with the same type.

Code Snippets

C# v2


DMWeb_REST.DMWeb dmweb = new DMWeb_REST.DMWeb("https://ssl.datamotion.com/SecureMessagingAPI");

Messaging_Library.Models.MessagingModels.MessageOperations moveMessage = new Messaging_Library.Models.MessagingModels.MessageOperations();
moveMessage.DestinationFolderId = 150;
moveMessage.MessageId = 566; 

string response = dmweb.Message.Move(moveMessage).GetAwaiter().GetResult();

C# v1.0.3


DMWebLib.Messaging MessagingLib = new DMWebLib.Messaging("https://ssl.datamotion.com/CMv4/CMv4.asmx");
int MID = 12345;
int FID = 1278;
MessagingLib.MoveMessage(sessionkey, MID, FID);

SOAP


POST /cmv4/cmv4.asmx HTTP/1.1
Host: ssl.datamotion.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://ssl.datamotion.com/CMv4/MoveMessage"

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance">
    <soap:Body>
        <MoveMessage xmlns="https://ssl.datamotion.com/CMv4">
            <SessionKey>string</SessionKey>
            <MID>int</MID>
            <DestFID>int</DestFID>
        </MoveMessage>
    </soap:Body>
</soap:Envelope>
box icon

DELETE A MESSAGE

This method is used to remove a message from a DataMotion account folder. When a message is deleted, it is normally moved to a Trash folder and then a Deleted Trash folder before being permanently purged from the DataMotion account. The trash deletion mechanism is controlled by the DataMotion Server. Deleting a message only removes the message from the current user’s account. It does not remove the message from the account of any other DataMotion users referenced in the message.

Code Snippets

C# v2


DMWeb_REST.DMWeb dmweb = new DMWeb_REST.DMWeb("https://ssl.datamotion.com/SecureMessagingAPI");

string response = dmweb.Message.Delete("123456", true).GetAwaiter().GetResult();

C# v1.0.3


DMWebLib.Messaging MessagingLib = new DMWebLib.Messaging("https://ssl.datamotion.com/CMv4/CMv4.asmx");
int inboxOutbox = 0;
int MID = 12345;
bool permanentlyDelete = false;
string response = MessagingLib.DeleteMessage(sessionkey, inboxOutbox, MID, false);

SOAP


POST /cmv4/cmv4.asmx HTTP/1.1
Host: ssl.datamotion.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://ssl.datamotion.com/CMv4/DeleteMessage"

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance">
    <soap:Body>
        <DeleteMessage xmlns="https://ssl.datamotion.com/CMv4">
            <SessionKey>string</SessionKey>
            <FolderType>int</FolderType>
            <MID>int</MID>
            <PermanentlyDelete>boolean</PermanentlyDelete>
        </DeleteMessage>
    </soap:Body>
</soap:Envelope>


HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance">
    <soap:Body>
        <DeleteMessageResponse xmlns="https://ssl.datamotion.com/CMv4">
            <DeleteMessageResult>string</DeleteMessageResult>
        </DeleteMessageResponse>
    </soap:Body>
</soap:Envelope>
box icon

RETRACT A MESSAGE

Retracts a message from any recipients that have received the message. A message can be retracted whether or not the recipient has read the message, but the message will remain in that user’s account until it expires or the recipient deletes it.

Code Snippets

C# v2


DMWeb_REST.DMWeb dmweb = new DMWeb_REST.DMWeb("https://ssl.datamotion.com/SecureMessagingAPI");

Messaging_Library.Models.MessagingModels.MessageOperations retract = new Messaging_Library.Models.MessagingModels.MessageOperations();
retract.MessageId = 567;

string response = dmweb.Message.Retract(retract).GetAwaiter().GetResult();

C# v1.0.3


DMWebLib.Messaging MessagingLib = new DMWebLib.Messaging("https://ssl.datamotion.com/CMv4/CMv4.asmx");
int MID = 12345;
MessagingLib.RetractMessage(sessionkey, MID);

SOAP


POST /cmv4/cmv4.asmx HTTP/1.1
Host: ssl.datamotion.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://ssl.datamotion.com/CMv4/RetractMessage"

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance">
    <soap:Body>
        <RetractMessage xmlns="https://ssl.datamotion.com/CMv4">
            <SessionKey>string</SessionKey>
            <MID>int</MID>
        </RetractMessage>
    </soap:Body>
</soap:Envelope>
box icon

GET MAILBOX XML

This method is used to get the mailbox of the current user, with header information regarding the messages in a particular folder for a specific Mailbox Type (inbox or outbox). This method will be removed from new releases, beginning with 5.37 (SecureMail) and 6.2 (Direct).

Code Snippets

C# v1.0.3


DMWebLib.Messaging MessagingLib = new DMWebLib.Messaging("https://ssl.datamotion.com/CMv4/CMv4.asmx");
int inboxOutbox = 0;
int pageNum = 1;
string orderBy = "DATE";
int FID = 1;
string searchFilter = "";
int pageSize = 10;
bool descending = false;
DataSet dataSet = MessagingLib.GetMailboxXML(sessionkey, inboxOutbox, pageNum, orderBy, FID, searchFilter, pageSize, descending);
box icon

UN-DELETE A MESSAGE

This method calls the UnDelete function provided by the library which performs the SOAP MoveMessage function on a message that was deleted from the inbox.

Code Snippets

C# v1.0.3


DMWebLib.Messaging MessagingLib = new DMWebLib.Messaging("https://ssl.datamotion.com/CMv4/CMv4.asmx");
int MID = 12345;
DMLib.UndeleteMessage(sessionkey, MID);
box icon

GET IN-TRANSIT STATE

This method is used to retrieve the InTransit state of a message.

Code Snippets

C# v1.0.3


DMWebLib.Messaging MessagingLib = new DMWebLib.Messaging("https://ssl.datamotion.com/CMv4/CMv4.asmx");
int inboxOutbox = 0;
int MID = 12345;
string response = DMLib.GetInTransit(sessionkey, inboxOutbox, MID);

SOAP


POST /cmv4/cmv4.asmx HTTP/1.1
Host: ssl.datamotion.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://ssl.datamotion.com/CMv4/GetInTransit"

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance">
    <soap:Body>
        <GetInTransit xmlns="https://ssl.datamotion.com/CMv4">
            <SessionKey>string</SessionKey>
            <FolderType>int</FolderType>
            <MID>int</MID>
        </GetInTransit>
    </soap:Body>
</soap:Envelope>




HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance">
    <soap:Body>
        <GetInTransitResponse xmlns="https://ssl.datamotion.com/CMv4">
            <GetInTransitResult>string</GetInTransitResult>
        </GetInTransitResponse>
    </soap:Body>
</soap:Envelope>
box icon

SET IN-TRANSIT STATE

This method is used to set the InTransit state of a message.

Code Snippets

C# v1.0.3


DMWebLib.Messaging MessagingLib = new DMWebLib.Messaging("https://ssl.datamotion.com/CMv4/CMv4.asmx");
int inboxOutbox = 0;
int MID = 12345;
bool inTransit = false;
DMLib.SetInTransit(sessionkey, inboxOutbox, MID, inTransit);

SOAP


POST /cmv4/cmv4.asmx HTTP/1.1
Host: ssl.datamotion.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://ssl.datamotion.com/CMv4/SetInTransit"

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance">
    <soap:Body>
        <SetInTransit xmlns="https://ssl.datamotion.com/CMv4">
            <SessionKey>string</SessionKey>
            <FolderType>int</FolderType>
            <MID>int</MID>
            <InTransitValue>boolean</InTransitValue>
        </SetInTransit>
    </soap:Body>
</soap:Envelope>

More Information

Message Status Definitions

The following table lists the correlations between the delivery or processing state of a message and the integer value associated with it. The GetInboxUnreadOnly parameter relies upon the status shown in the Read/Unread status column of the table. “Notice” refers to Notification Messages.

Sender-Only Status Types (<=0)

Message StatusValueRead/Unread Status
DirectMessageFailed-8
PendingUpload-7
PendingLicense-6
Pending-5
Restricted-4
Deleted-3
Retracted-2
Draft-1
EditMode0

Sender/Recipient Status Types (>=0)

Message StatusValueRead/Unread Status
NoticeInQueue1Unread
NoticeSent2Unread

Per Recipient (not per message) Status Types

Message StatusValueRead/Unread Status
UnRead3Unread
Read4Read

Push Status Types

Message StatusValueRead/Unread Status
SentPlainText5Read
NoticeError6Unread
Pop3Delivered7Read
PushedZip8Read
SecureFax9Read
PushedPdf10 Read

SecureForms Status Types

Message StatusValueRead/Unread Status
DistributionRequestProcessed11Unread
DistributionRequestFailed12Unread

DataBridge Status Types

Message StatusValueRead/Unread Status
WorkflowDestinationEnroute13Unread
WorkflowDestinationDelivered14Read
WorkflowDestinationUnreachable15Unread

DataMotion Direct Status Types

Message StatusValueRead/Unread Status
DirectMessageQueued16Unread (Tracking)
DirectMessageSent17Unread (Tracking)
DirectMessageDispatched18Unread (Tracking)
DirectMessageProcessed19Unread (Tracking)

Errors

The following table lists possible errors that may appear in the responses of the Messaging API methods.

General Errors

Error TextError Description
SessionKey ExpiredThe transaction cannot be processed because of an expired SessionKey.
An error has occurred at [DateTime] please check the server logs for details.Contact DataMotion Support

Login Errors

Error TextError Description
User account has not been verifiedThe user's account has not been verified
Password expired. User must change their password to use this functionPassword must be reset
User credentials are invalid.Either an incorrect User ID/password was used
User DisabledThe user has been disabled by the system's administrator
Too many invalid logon attempts. User automatically disabledThe user has been disabled by too many invalid logon attempts. Contact your administrator to re-enable the user
User is not authorized to use the Web Service APIContact your administrator to enable access to the specific Web Service API
User could not be authenticatedGeneric, catch-all error

GetMIMEMessage Errors

Error TextError Description
The user associated with the SessionKey: [ SessionKey] does not have permission to access MID: [MID]This can happen for a variety of reasons: the message was not sent/received from/by the user, the message has been deleted, the message expired, etc.
This message has been deleted from Track Sent and is no longer availableDeleted messages cannot be retrieved
The message has been deleted from the Inbox and is no longer available.Deleted messages cannot be retrieved

SendMIMEMessage Errors

Error TextError Description
File sizes > 2gb are not supportedThe attachment included in the message is too large
Note:   An improperly formatted MIME message will not trigger an error, but rather return the MID of the message that has been saved in the Drafts folder

CreateFolder Errors

Error TextError Description
Folder could not be created. The Folder Type and Folder Name is invalidThe Folder Type can only be 0 (inbox) or 1 (outbox)
Folder could not be created. The Folder Name already existsThe Folder Name already exists for this user
Folder could not be created. The Folder Name is too longThe maximum length for a Folder Name is 65 characters
Folder could not be created. Unknown errorGeneric, catch-all error

DeleteMessage Errors

Error TextError Description
Message could not be deletedYou may not have permission to delete this message or it may have already been deleted from the system
The message could not be permanently deleted from the serverThe message could not be deleted
Message could not be permanently deleted from the user's accountThe message could not be deleted
Message could not be moved to the deleted trash folderThe message could not be deleted
Message could not be moved to the trash folderThe message could not be deleted

Provisioning API

This information describes the services available to provision companies on the DataMotion SecureMail platform

Note: The Provisioning API is sometimes referred to as remote manager provisioning web service

box icon

PROVISION A COMPANY

This method can provision, update, or delete a company.

Code Snippets

C#

DMWebLib.Provisioning ProvisionLib = new DMWebLib.Provisioning("ABCDE12345");

DMWebLib.Models.Provisioning.UserModel Admin = new DMWebLib.Models.Provisioning.UserModel { Email = "email@example.com", FirstName = "John", LastName = "Doe", PhoneNumber = "5555555555" };
DMWebLib.Models.Provisioning.BillingIntervalModel BillingInterval = new DMWebLib.Models.Provisioning.BillingIntervalModel { Monthly = true, Years = 0 };

List<DMWebLib.Models.Provisioning.UserTypeModel> UserTypes = new List<DMWebLib.Models.Provisioning.UserTypeModel>();
UserTypes.Add(new DMWebLib.Models.Provisioning.UserTypeModel{ LicenseQuantity = 10, UserTypeCode = "1" });

DMWebLib.Models.Provisioning.SecureContactModel SecureContacts = new DMWebLib.Models.Provisioning.SecureContactModel { DisplayName = "Sales", Email = "sales@mycompany.com", UserTypeCode = "1" };
DMWebLib.Models.Provisioning.CobrandModel Cobrand = new DMWebLib.Models.Provisioning.CobrandModel { Color ="#ff000", Url = "www.mycompanyinc.com", SecureContacts = SecureContacts}

DMWebLib.Models.Provisioning.CompanyModel ProvisioningCompanyModel = new DMWebLib.Models.Provisioning.CompanyModel { ReferenceId = "12345ABC", CompanyName = "My Company, Inc.", ExpirationDate = DateTime.Now.AddYears(10).ToString(), Status = DMWebLib.Models.Provisioning.Status.Active, Admin = Admin, UserTypes= UserTypes, BillingInterval = BillingInterval, Cobrand = Cobrand };

DMWebLib.Models.Provisioning.ResponseModel ResponseModel = new DMWebLib.Models.Provisioning.ResponseModel();

ResponseModel = ProvisionLib.Provision(ProvisioningCompanyModel, "username", "platformCode", DMWebLib.Models.Provisioning.Command.Create, "email@example.com");
box icon

GET AN ENCRYPTION KEY

This method returns a company encryption key associated with a provided AutomationId. If no AutomationId is provided, this method will return the default encryption key for the company.

Code Snippets

C#

DMWebLib.Provisioning ProvisionLib = new DMWebLib.Provisioning("ABCDE12345");

DMWebLib.Models.Provisioning.AutomationKeyModel AutomationModel = new DMWebLib.Models.Provisioning.AutomationKeyModel { ApiEncryptionKey = "ABCDEFGHIJKLMNOP", AutomationId = "MyCompany123", ReferenceId = "ABCDEFG" };

DMWebLib.Models.Provisioning.ResponseModel ResponseModel = new DMWebLib.Models.Provisioning.ResponseModel();

ResponseModel = ProvisionLib.GetEncryptionKey(AutomationModel, "email@example.com", "JohnDoe", "Platform1");
box icon

CREATE A NEW ENCRYPTION KEY

This method generates and returns a new company encryption key, if an AutomationId is provided, thus invalidating any existing keys. If an AutomationId is not provided, a new AutomationId will also be generated.

Code Snippets

C#

DMWebLib.Provisioning ProvisionLib = new DMWebLib.Provisioning("ABCDE12345");

DMWebLib.Models.Provisioning.AutomationKeyModel AutomationModel = new DMWebLib.Models.Provisioning.AutomationKeyModel { ApiEncryptionKey = "ABCDEFGHIJKLMNOP", AutomationId = "MyCompany123", ReferenceId = "ABCDEFG" };

DMWebLib.Models.Provisioning.ResponseModel ResponseModel = new DMWebLib.Models.Provisioning.ResponseModel();

ResponseModel = ProvisionLib.NewEncryptionKey(AutomationModel, "email@example.com", "JohnDoe", "Platform1");;

More Information

Errors

The following table lists possible errors that may appear in the responses of the Provisioning API methods.

Company Errors

Error NameError Description
CouldNotCreateCompanyThe company could not be created for a reason not listed elsewhere
CompanyNotFoundThe company name did not match any existing company when attempting to update the company
CompanyTypeNotFoundThe company type was not found when attempting to create the company
CompanyNameAlreadyExistsThe company name matched an existing company when attempting to create the company
DomainAlreadyRegisteredAn attempt to associate an AutoSenderDomain with the company failed as the domain is already associated with another company
UnableToRegisterDomainAn error occurred while attempting to register a domain but the domain is not neccessarily already registered
ReferenceIdAlreadyUsedThis error will occur when trying to create a new company with a previously used ReferenceId
UnknownCompanyStatusA status other than 0, 1, or 2 ("Active", "Trial", or "Cancelled") was specified
BillingPeriodInvalidEither: Monthly = true and Years < > 0, or Monthly = false and Years is not greater than or equal to 1
PastExpirationDateThe date supplied in the request is in the past

Admin Errors

Error NameError Description
CouldNotCreateAdminThe administrative user could not be created for a general reason. This error will be accompanied with a User Error listed below

User Errors

Error NameError Description
CouldNotLoadUserIndicates an existing user could not be loaded
UserNotInCompanyTrying to update a user whose email address already exists in another company
CouldNotAddUserToUserTypeMay occur if a user is already registered as a paid user or in the administrative role
CouldNotUpdateUserThis error should be accompanied by a more specific error message as to why the user could not be updated
CouldNotCreateUserGeneral error
InvalidUserIdThe ID used to identify the user is invalid
ErrorDeletingUserThis error should be accompanied by a more specific error message as to why the user could not be deleted
InvalidEmailAddressThe supplied email does not follow a standard name@domain.com well-formed format

UserType Errors

Error NameError Description
TemplateNotFoundThe UserType feature set could not be found
UserTypeNotFoundThe specified UserType is not a valid selection
LicenseQuantityLessThanNumberOfUsersThe requested LicenseQuantity update count is less that the current number of users already provisioned for that UserType
CouldNotCreateTypeThe instance could not create the feature set
ErrorDeletingUserTypeAn error occured while rolling back a failed transaction. This error should be accompanied by a more specific error message as to why the transaction needed to be rolled back

Cobrand Errors

Error NameError Description
CouldNotCreateCobrandCobrand could not be created for a general reason not listed below
IncompleteCobrandDataAll cobrand data, with the exception of SecureContacts, is required upon creation or update
CobrandExistsAnother company with the same first 8 characters already exists with a cobranded portal
UnableToProcessCobrandLogoThis is a system error
MoreSecureContactsThanLicensesThe number of requested SecureContacts exceeds the amount of available licenses for the UserType specified
SecureContactProvisioningNotAllowedNone of the UserType feature sets provisioned for this company include SecureContact functionality
SecureContactRequiresCobrandProvisioning a SecureContact requires a cobrand be specified

Other Errors

Error NameError Description
NotAuthorizedThe UserName supplied is invalid
BadCryptoSupplied Hash does not match computed Hash
InvalidPlatformNameThe supplied value does not match a DataMotion instance that the user is authorized to provision
UnknownCommandA Command other than "Create" (1), "Update" (2), or "Cancel" (3) was supplied
ErrorConnectingToRemotePlatformThe DataMotion instance was non-responsive
InvalidDateThe ExpirationDate either: is improperly formatted (mm/dd/yyyy), contains an invalid month (ie: <1 or >12 ), contains an invalid day (ie: <1 or >31), or specifies a day that is invalid in combination with the month
MalformedJsonStringThe decrypted Data string is incorrectly formatted or serialized
UnknownErrorGeneric catch-all

HPD API

This information describes the services available to utilize the Healthcare Provider Directory (HPD) on the DataMotion Direct platform

box icon

GET A SESSION KEY

There does not exist a DMWeb equivalent of an HPD-specific authentication method, as a SessionKey obtained from any other DataMotion web services (ie: Admin API, Messaging API) can be used instead.