MailSuite Pro 7 documentation

Receiving mail

FoldersGetList

Return list of folders available in specific account.

Request Item Type Sample value Description
AccountID int 1 ID of account folders are retrieved for
Action string "FoldersGetList"
AuthToken string "89e307c653d701c17d61f2f116dba618” string obtained with SystemLogin. Not needed if client supports cookies.
Token string "169874786e1d429e20fd993800a8c08c"

Sample response:

{
  "Action":"FoldersGetList",
  "AccountID":1,
  "Result":
  {
    "@Object":"Collection/FolderCollection",
    "@Count":40,
    "@Collection":
      [
        {
          "@Object":"Object/Folder",
          "Type":1,
          "Name":"INBOX",
          "FullName":"INBOX",
          "FullNameRaw":"INBOX",
          "FullNameHash":"7e33429f656f1e6e9d79b29c3f82c57e",
          "Delimiter":"/",
          "IsSubscribed":true,
          "IsSelectable":true,
          "Exists":true,
          "Extended":null,
          "NamespaceFolder":false,
          "SubFolders":null
        },
        {
          "@Object":"Object/Folder",
          "Type":2,
          "Name":"AfterLogicSent",
          "FullName":"AfterLogicSent",
          "FullNameRaw":"AfterLogicSent",
          "FullNameHash":"d0f0107b8fff514be25a5c88e0e30117",
          "Delimiter":"/",
          "IsSubscribed":true,
          "IsSelectable":true,
          "Exists":true,
          "Extended":null,
          "NamespaceFolder":false,
          "SubFolders":
          {
            "@Object":"Collection/FolderCollection",
            "@Count":3,"@Collection":
            [
              {
                "@Object":"Object/Folder",
                "Type":10,
                "Name":"????",
                "FullName":"AfterLogicSent/????",
                "FullNameRaw":"AfterLogicSent/&BEIENQRBBEI-",
                "FullNameHash":"abda7ec45937220be7c2e0c7db45690b",
                "Delimiter":"/",
                "IsSubscribed":true,
                "IsSelectable":true,
                "Exists":true,
                "Extended":null,
                "NamespaceFolder":false,
                "SubFolders":null
              }
            ],
            "Namespace":""
          }
        }
      ],
      "Namespace":""
    },
  "@Time":3.2817389965057
}

Depending on mail server, Extended field may contain information on current status of the folder:

  • hash which is changed whenever message list is updated;
  • UID which is assigned for next message added to folder;
  • number of all and unread messages in folder.

If this field contains null, this information is retrieved with FoldersGetRelevantInformation request.

FoldersGetRelevantInformation

This request is used for retrieving basic information on folders, if FoldersGetList request returned null value for Extended parameter, and for subsequent checks whether folder was updated.

Request Item Type Sample value Description
AccountID int 1 ID of the account
Action string "FoldersGetRelevantInformation"
AuthToken string "89e307c653d701c17d61f2f116dba618” string obtained with SystemLogin. Not needed if client supports cookies.
Folders array ["INBOX", "AfterLogicSent", "AfterLogicSent/&BEIENQRBBEI-"] array of FullNameRaw names of folders data to be retrieved for. Initially, } requests data on all folders, subsequently - only for those which require status check.
FullNameRaw - parameter from response to FoldersGetList request.
InboxUidnext string "" optional; UID assigned to next message in Inbox, used to determine if there were new message in Inbox (new, not unread) - and if yes, display notification on that.
Token string "169874786e1d429e20fd993800a8c08c"

Sample response:

{
  "Action":"FoldersGetRelevantInformation",
  "AccountID":1,
  "Result":
  {
    "Counts":
    {
      "AfterLogicSent":[67,0,"1623","d77cb96b8b025bcaa2edfa25a42ff38d"],
      "AfterLogicSent/Customers":[58,0,"63","c8f5f40cf5a6bb323db9d64846d0fc87"],
      "INBOX":[339,0,"11788","ad05dc5ecb61b2d18983ebbfacb6bb30"]
    },
    "New":[]
  },
  "@Time":2.4511110782623
}

MessagesGetList

Request for retrieving a list of messages in a folder. It supports filtering and search.

Request Item Type Sample value Description
AccountID int 1 ID of the account
Action string "MessagesGetList"
AuthToken string "89e307c653d701c17d61f2f116dba618” string obtained with SystemLogin. Not needed if client supports cookies.
Filters string "" optional
"" - no filtering, "unseen" - unread only, "flagged" - starred only
Folder string "INBOX" FullNameRaw of the folder we retrieve message list for
FullNameRaw - parameter from response to FoldersGetList request.
InboxUidnext string "" optional
Limit int 10 number of messages to be returned
Offset int 0 offset for message list
Search string "" optional; search string
Token string "169874786e1d429e20fd993800a8c08c"
UseThreads int 0 optional; 1 if threads should be used, 0 otherwise.

Sample response:

{
  "Action":"MessagesGetList",
  "AccountID":1,
  "Result":
  {
    "@Object":"Collection\/MessageCollection",
    "@Count":10,
    "@Collection":
    [
      {
        "@Object":"Object\/MessageListItem",
        "Folder":"INBOX",
        "Uid":11800,
        "Subject":"Settings - BUG - \u041e\u0447\u0438\u0449\u0430\u044e\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430 [Proj 7.6 (\u0410\u043f\u0440\u0435\u043b\u044c 2015)]",
        "MessageId":"<972992e9d3b51c38806cd9f3ab27a105@asana.com>",
        "Size":42291,
        "TextSize":13880,
        "InternalTimeStampInUTC":1428005433,
        "ReceivedOrDateTimeStampInUTC":1428005432,
        "TimeStampInUTC":1428005433,
        "From":
        [
          {
            "@Object":"Object\/Email",
            "DisplayName":"Hisname",
            "Email":"reply-d23778051e01e1545@asana.com"
          }
        ],
        "To":
        [
          {
            "@Object":"Object\/Email",
            "DisplayName":"Myname",
            "Email":"myemail@afterlogic.com"
          }
        ],
        "Cc":null,
        "Bcc":null,
        "Sender":null,
        "ReplyTo":
        [
          {
            "@Object":"Object\/Email",
            "DisplayName":"",
            "Email":"2.3074061025ml88uc@mail.asana.com"
          }
        ],
        "IsSeen":true,
        "IsFlagged":false,
        "IsAnswered":false,
        "IsForwarded":false,
        "HasAttachments":false,
        "HasVcardAttachment":false,
        "HasIcalAttachment":false,
        "Priority":3,
        "DraftInfo":null,
        "Sensitivity":0,
        "TrimmedTextSize":13880,
        "Hash":"A3WxjSm50Oi77ZGz5NDPioaDrR4FiHyE6IJZpYtvXf7BODBsyMJx7oYSoHPe5Lx8oqJ59NASlyUApe5xgnnmuV9IE1uVPTQHb4l5-1Weh42Pf22h2rSndFs9xuiUSgMtV7hTOX3B9mdaRzgZ5r4p8k7UU1fTkGW4_M-xYVbnQ0uEdmCwr7XSEJTZeJlA19ihDv7I8MgzmCAPqvHSHOoAj8eqLngJaq3O8thzG-s6dWGZn1IC_bbt5wOUcyPketo2bteIXumOagXqvEPx_DJ7AaLikhK0JszGmLnjjUIrluP3ik1unaI4zZzaawXXO08o",
        "Threads":[11799,11798,11797,11796],
        "Custom":[]
      },
      ...
    ],
    "Uids":[11800,11795,11794,11792,11790,11788,11787,11786,11785,11783],
    "UidNext":"11801",
    "FolderHash":"3e570121604405c737cb166194775618",
    "MessageCount":351,
    "MessageUnseenCount":0,
    "MessageResultCount":169,
    "FolderName":"INBOX",
    "Offset":0,
    "Limit":10,
    "Search":"",
    "Filters":"",
    "New":[]
  },
  "@Time":3.5820579528809
}

MessageGet

Retrieving data for a message with specific UID.

Request Item Type Sample value Description
AccountID int 1 ID of account
Action string "MessageGet"
AuthToken string "89e307c653d701c17d61f2f116dba618” string obtained with SystemLogin. Not needed if client supports cookies.
Folder string "INBOX" FullNameRaw of the folder we retrieve message from
FullNameRaw - parameter from response to FoldersGetList
Token string "169874786e1d429e20fd993800a8c08c"
Uid string "11800" UID of the message we need to fetch

Sample response:

{
  "Action":"MessageGet",
  "AccountID":1,
  "Result":
  {
    "@Object":"Object\/Message",
    "Folder":"INBOX",
    "Uid":11800,
    "Subject":"Settings - BUG - \u041e\u0447\u0438\u0449\u0430\u044e\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430 [Proj 7.6 (\u0410\u043f\u0440\u0435\u043b\u044c 2015)]",
    "MessageId":"<972992e9d3b51c38806cd9f3ab27a105@asana.com>",
    "Size":42291,
    "TextSize":26800,
    "InternalTimeStampInUTC":1428005433,
    "ReceivedOrDateTimeStampInUTC":1428005432,
    "TimeStampInUTC":1428005433,
    "From":
    [
      {
        "@Object":"Object\/Email",
        "DisplayName":"Hisname",
        "Email":"reply-d2377jd1b051e01e1545@asana.com"
      }
    ],
    "To":
    [
      {
        "@Object":"Object\/Email",
        "DisplayName":"Myname",
        "Email":"myemail@afterlogic.com"
      }
    ],
    "Cc":null,
    "Bcc":null,
    "Sender":null,
    "ReplyTo":
    [
      {
        "@Object":"Object\/Email",
        "DisplayName":"",
        "Email":"2.30740yriq4xlrz43y5ml88uc@mail.asana.com"
      }
    ],
    "IsSeen":true,
    "IsFlagged":false,
    "IsAnswered":false,
    "IsForwarded":false,
    "HasAttachments":false,
    "HasVcardAttachment":false,
    "HasIcalAttachment":false,
    "Priority":3,
    "DraftInfo":null,
    "Sensitivity":0,
    "TrimmedTextSize":25000,
    "Hash":"A3WxjSm50Oi77ZGz5NDPioaDrR4FiHyE6IJZpYtvXf7BODBsyMJx7oYSoHPe5Lx8oqJ59NASlyUApe5xgnnmuV9IE1uVPTQHb4l5-1Weh42Pf22h2rSndFs9xuiUSgMtV7hTOX3B9mdaRzgZ5r4p8k7UU1fTkGW4_M-xYVbnQ0uEdmCwr7XSEJTZeJlA19ihDv7I8MgzmCAPqvHSHOoAj8eqLngJaq3O8thzG-s6dWGZn1IC_bbt5wOUcyPketo2bteIXumOagXqvEPx_DJ7AaLikhK0JszGmLnjjUIrluP3ik1unaI4zZzaawXXO08o",
    "Headers":"Return-path: <bounces+9814-dcce-myemail=afterlogic.com@mail.asana.com>\r\nEnvelope-to: myemail@afterlogic.com\r\nDelivery-date: Thu, 02 Apr 2015 13:10:33 -0700\r\nReceived: from [167.89.34.203] (helo=o5.mail.asana.com)\r\n\tby mx.afterlogic.com with esmtps (TLSv1.2:DHE-RSA-AES128-GCM-SHA256:128)\r\n\t(Exim 4.82)\r\n\t(envelope-from <bounces+9814-dcce-myemail=afterlogic.com@mail.asana.com>)\r\n\tid 1YdlRe-0006BU-MW\r\n\tfor myemail@afterlogic.com; Thu, 02 Apr 2015 13:10:32 -0700\r\nDKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=mail.asana.com; \r\n\th=content-type:mime-version:from … ",
    "InReplyTo":"<244cac5f4a2abed3c4d8a0408@asana.com>",
    "References":"<244cac5f4a2bed3c4d8a0408@asana.com>",
    "ReadingConfirmation":"",
    "Html":"<div data-x-div-type=\"html\" ><div data-x-div-type=\"body\" >\n<div> ... <\/div>\n<\/div><\/div>",
    "Trimmed":false,
    "Plain":"",
    "PlainRaw":"",
    "Rtl":false,
    "ICAL":null,
    "VCARD":null,
    "Safety":true,
    "HasExternals":true,
    "FoundedCIDs":[],
    "FoundedContentLocationUrls":[],
    "Attachments"://null, if message contains no attachments
    [
      {
        "@Object":"Object/CApiMailAttachment",
        "FileName":"Message.html",
        "MimeType":"text/html",
        "MimePartIndex":"2",
        "EstimatedSize":1690,
        "CID":"",// Content-ID used for inline attachments
        "ContentLocation":"",
        "Thumb":false,
        "Expand":false,
        "Iframed":false,
        "Content":"",
        "IsInline":false,// true, if attachment headers state it's inline
        "IsLinked":false,// true, if attachment is actually referenced as image in message body
        "Hash":"-AIY6ErK0UHfC1MyPbdR2uAoaNosArVZxkRdbSYHd5BBMkNtSunFbu0XTtWccAGQGNlIn6OUcwUKWMsYRqxX6JiyS8LC6P9xnNuPM1ztaj-5BBHsQv0nVD77LDOzDizxHDoUrSchwO_aQWYUJtACfU1HekySjCdaGeW01UUl9OB2CpgoW2wjbcremcVfb_dFSDDpxQVN-OQEFxVz4yjuLA4R8ypJiU7r6dPJ5JywGQEuh8jgryDY3g.."
      },
      {
        "@Object":"Object/CApiMailAttachment",
        "FileName":"image001.png",
        "MimeType":"image/png",
        "MimePartIndex":"3",
        "EstimatedSize":21457,
        "CID":"image001.png@01D07613.013A2B70",
        "ContentLocation":"",
        "Thumb":true,
        "Expand":false,
        "Iframed":false,
        "Content":"",
        "IsInline":false,
        "IsLinked":true,
        "Hash":"sN2MQ_M-I6o3GtIpSrkKEcWeaDUUzMsymZkmZzXNyFBzkC8_nEr4c-IwAmQKMyQUl154NlHNOHty-BPE5f0Tai4B6oX1Pab55hr9CNC5yHp5UVA-uTBRRQSXsunSoyDB11dN6NHk16BwoZmUuFfPGZUcbWZb7cV_tGva6wbQUd0bHm-AtIcAVvJqgM734N1CVZPT5VZ6EAzinGus3tGR2SFDi7aoLresAbugizCZY9K9XgfM2Ykneg.."
      }
    ],
    "Custom":[]
  },
  "@Time":3.1465380191803
}

Hash is used in links for downloading file, and for viewing it if specific file type is supported.

Download link format: '?/Raw/Download/' + AccountID + '/' + Hash

File view link format: '?/Raw/View/' + AccountID + '/' + Hash

In case if you're not using web browser and cookies are unavailable, a different approach needs to be used for getting view/download links. It involves AuthToken value returned by SystemLogin call.

Download link format: '?/Raw/Download/' + AccountID + '/' + Hash + '/0/hash/' + AuthToken

File view link format: '?/Raw/View/' + AccountID + '/' + Hash + '/0/hash/' + AuthToken