MailSuite Pro documentation



This API allows applications to communicate with backend code of MailSuite Pro. In essence, you can create your custom frontend which would interact with MailSuite Pro backend via Web API. Note that the application which uses Web API doesn't have to be a web application, you can use this API in mobile, desktop and server applications as well.

Usually, one would call SystemGetAppData method to obtain authentication token, then log user in with SystemLogin method call. After that, it's possible to obtain list of folders, request message list, read and send mails, etc.

Note that you can also use PHP API to manipulate messages, folders etc. if your application and MailSuite Pro are installed on the same server. Also, you can manipulate domains and accounts via REST API.

Getting Started

To start working with specific user account via API, you'll need to initialize API by performing SystemGetAppData request. Below, please find an example of the code written in C#, which performs the request.

string url = "";
using (var client = new WebClient())
	client.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
	string strData = "Action=SystemGetAppData";
	strData = client.UploadString(url, strData);

The following points are important in this regard:

1) The entry point for making all the Web API calls is MailSuite Pro installation URL with /?/Ajax/ appended.

2) If the installation is accessed via HTTPS, URL for API call needs to have https:// there, even if the installation is configured to redirect from http:// automatically.

3) All the Web API calls are to be performed using POST; WebClient.UploadString method used in the above code always uses POST.

4) Content-Type of the request must be set to "application/x-www-form-urlencoded".

Upon performing the request, store Token value returned by this request. Below please see the example of response structure pertaining to where exactly Token is found.

Then, log user into their MailSuite Pro account by running SystemLogin request. This request returns response of the following kind:


From the above result, AuthToken and AccountID values need to be stored.

The three items we have stored - Token, AuthToken and AccountID will be required for performing all the further requests.

Error Codes

Typical response returned on failure looks like this:

  "ErrorMessage":"TAG1 NO Authentication failed."

The following ErrorCode values are supported:

* 101 - invalid token;

* 102 - authentication failure;

* 103 - invalid data;

* 104 - database error;

* 999 - method not found.


You can find the list of currently supported Web API methods below. All the methods return the response in JSON format.

Note that if your application runs on iOS or OS X, JSON data are represented as NSDictionary object. If particular key starts with @ character, you should use objectForKey method to retrieve the value:

[collection objectForKey:@"@Collection"];

The following would be incorrect:

[collection valueForKey:@"@Collection"];

System methods


Web API initialization requests. There are 2 cases when this request needs to be performed:

1) When opening login page, the following data will be returned:

* Token - token string which is used for protection from forged requests and which needs to be sent in each subsequent request;

* data needed for displaying login page, such as SiteName, DefaultLanguage, DefaultTheme, etc.

2) Right after logging in, to obtain user settings and account list.

Request Item Type Sample value Description
AccountID int 0 ID of user logged in, 0 if not logged in
Action string "SystemGetAppData"
Token string "169874786e1d429e20fd993800a8c08c" string obtained with this request earlier, or an empty string
AuthToken string "89e307c653d701c17d61f2f116dba618” string obtained with SystemLogin request
Not needed if client supports cookies or if user isn't logged in yet.

Sample response:

    "User":// null, if Auth = false, i.e. not logged in
      "DefaultDateFormat":"DD Month YYYY",
    "Default":1,// not available if Auth = false, i.e. not logged in
    "Accounts":// null, if Auth = false, i.e. not logged in
          "FriendlyName":"\u041d\u0430\u0434\u0435\u0436\u0434\u0430 \u0428\u0438\u043f\u0438\u043a\u0430",
            "Signature":"<div data-crea=\"font-wrapper\" style=\"font-family: Tahoma; font-size: 16px; direction: ltr\">/ \u041d\u0430\u0434\u0435\u0436\u0434\u0430 \u0428\u0438\u043f\u0438\u043a\u0430</div>",
      "SiteName":"AfterLogic WebMail Pro",
      "DateFormats":["MM/DD/YYYY","DD/MM/YYYY","DD Month YYYY"],
      "LoginFormType":0,//0 for email, 3 for login, 4 for both


Log user into their MailSuite Pro account.

Request Item Type Sample value Description
AccountID int 0 optional
Action string "SystemLogin"
Email string "" email of account we're logging into
IncLogin string "" optional if SystemGetAppData returned LoginFormType value 0 (default value)
IncPassword string "12345"
SignMe int 1 optional; if set to 1, MailSuite Pro will log this user in next time automatically
Token string "169874786e1d429e20fd993800a8c08c"

Sample response:

    "AuthToken":"89e307c653d701c17d61f2f116dba618" // used to maintain sessions on cookieless clients


Log user out of their MailSuite Pro account.

Request Item Type Sample value Description
AccountID int 1 ID of user logged in
Action string "SystemLogout"
AuthToken string "89e307c653d701c17d61f2f116dba618” string obtained with SystemLogin. Not needed if client supports cookies.
Token string "169874786e1d429e20fd993800a8c08c"

Sample response:

  "Result": true,

Web API methods

Receiving mail

Sending mail


Uploading files