This API will soon be deprecated. Please use another API.

    Get Messages from the Specified Folder

    Gets messages from the specified folder.

    API Type

    Service API

    Request URL

    https://apis.worksmobile.com/{API ID}/mail/getMailList

    HTTP Method

    GET/POST(Content-Type: application/x-www-form-urlencoded; charset=UTF-8)

    Request

    Parameter Type Required Description
    folderSN Integer Y The serial number of a folder where messages will be retrieved.
    The following numbers indicate the serial number of a system folder and its corresponding folder name.
    ● -1: All mailbox
    ● 0: Inbox
    ● 1: Sent Mail
    ● 2: Mail Tracking
    ● 3: Temporary
    ● 4: Trash
    ● 5: Spam Mail
    ● 6: Mail to Me
    If the number is greater than 100, it indicates that it is created by a user.
    page Integer N Page number to be retrieved
    Example) 1
    pageSize Integer N The number of messages to be displayed in one page.
    If this value is not set, a user defined value is used.
    Example) 30
    type String N Specifies messages to retrieve
    ● "all": All messages
    ● "mark": Messages marked as important
    ● "attach": Messages that contain file attachments
    ● "tome": Messages where my email address is added in To field
    sortField Integer N Sort by
    ● 1: Date
    ● 3: From
    ● 4: To
    ● 5: Subject
    ● 6: Size
    ● 8: Marked Mail
    ● 9: Attached File(s)
    ● 11: Date of messages in Temporary
    sortType Integer N Sort by
    ● 0: Descending
    ● 1: Ascending
    isUnread Boolean N Indicates whether to retrieve unread messages only
    ● true: Unread messages only
    ● false: All messages

    Request Example

    https://apis.worksmobile.com/ClientOpenAPIID/mail/getMailList
    

    Response

    It returns the value of the "data" property which contains the results when the API call succeeds.

    Property Type Required Description
    currentTime Long Y Current time; it is displayed as UNIX timestamp.
    Example) 1409208669
    lastPage Integer Y Last page number
    Example) 3
    totalCount Integer Y Total number of messages
    Example) 100
    listCount Integer Y Total number of pages
    Example) 3
    unreadCount Integer Y The number of unread messages
    Example) 10
    pageSize Integer Y The number of messages to be displayed in one page
    Example) 30
    folderName String Y Folder name
    Example) Sent Mail
    mailData List Y Information of a message list to be retrieved
    priority Integer Y Importance level of a message
    Example) 3
    size Integer Y Message size (unit: byte)
    Example) 1024
    threadCount String Y The number of messages sent and received in Thread View
    Example) 0
    threadId String Y Thread message ID
    Example)a1903976041747540dbfc1dd0e99c86@example.com
    status Integer Y Message status
    ● 0: Unread
    ● 1: Read message
    ● 2: Unread important message
    ● 3: Read important message
    subject String Y Message subject
    mailSN Integer Y Message serial number
    Example) 1234
    mimeSN String Y MIME serial number
    Example) 1408959094.599851.19650.619501
    from List Y Message sender list
    name String Y Message sender name
    email String Y Message sender's email address
    toList List Y Message recipient list
    name String Y Message recipient name
    email String Y Message recipient's email address
    attachInfo String Y Attachment information
    preview String Y Preview messages
    receivedTime Long Y Received time; it is displayed as UNIX timestamp.
    Example) 1408959094
    attachCount Integer Y The number of attachments
    Example) 1
    folderSN Integer Y Folder serial number
    Example) 6
    folderName String Y Folder name
    Example) Sent Mail
    tome Boolean Y Indicates whether my email address is added in To field.
    ● true: Added in To field
    ● false: Added in C.C. field
    securityLevel String Y Security level of a message
    SECRET: Confidential
    IN_HOUSE: Restricted
    NORMAL: General
    sentTime Long Y Message sent time; it is displayed as UNIX timestamp.
    Example) 1408959094
    color String Y The value for the background color displayed when messages are retrieved
    Example) #ffffff
    reSend Boolean Y Indicates whether a message can be resent.
    ● true: Allow
    ● false: Not allow
    spamType String Y Spam message filter
    ● "SYSTEM_DEFINE": Created by system
    ● "USER_DEFINE": Created by users
    ● "USER_REPORT": Reported as spam messages by users
    ● "USER_MOVE": Moved to Spam Mail by users
    unreadThreadCount Integer Y The number of unread thread messages in Thread View
    Example) 0

    Response Example

    {
        "returnCode": "000",
        "data": {
            "currentTime": 1409126091,
            "lastPage": 1,
            "mailData": [
                {
                    "priority": 3,
                    "size": 1042,
                    "threadCount": 0,
                    "threadId": "<a1903976041747540dbfc1dd0e99c86@example.com>",
                    "status": 5,
                    "subject": "Hi",
                    "mailSN": 5,
                    "mimeSN": "1408959094.599851.19650.619501",
                    "from": {
                        "name": "Gildong Hong",
                        "email": "user01@example.com"
                    },
                    "toList": [
                        {
                            "name": "",
                            "email": "user01@example.com"
                        }
                    ],
                    "attachInfo": [],
                    "preview": "",
                    "receivedTime": 1408959094,
                    "attachCount": 0,
                    "folderSN": 6,
                    "folderName": null,
                    "toMe": false,
                    "securityLevel": "NORMAL",
                    "sentTime": 1408959094,
                    "iconType": 0,
                    "color": "#ffffff",
                    "reSend": true,
                    "spamType": null,
                    "unreadThreadCount": 0
                },
                {
                    "priority": 3,
                    "size": 196331,
                    "threadCount": 0,
                    "threadId": "<14363dcad647f36b603771dc9ea88ad0@example.com>",
                    "status": 5,
                    "subject": "Testing the load time of complex page...",
                    "mailSN": 2,
                    "mimeSN": "1408957487.49617.14930.64547",
                    "from": {
                        "name": "Gildong Hong",
                        "email": "user01@example.com"
                    },
                    "toList": [
                        {
                            "name": "",
                            "email": "user01@example.com"
                        }
                    ],
                    "attachInfo": [],
                    "preview": "",
                    "receivedTime": 1408957487,
                    "attachCount": 0,
                    "folderSN": 6,
                    "folderName": null,
                    "toMe": false,
                    "securityLevel": "NORMAL",
                    "sentTime": 1408957486,
                    "iconType": 0,
                    "color": "#ffffff",
                    "reSend": true,
                    "spamType": null,
                    "unreadThreadCount": 0
                },
                {
                    "priority": 3,
                    "size": 2079,
                    "threadCount": 0,
                    "threadId": "<67823c36f479f825abc761952852936@example.com>",
                    "status": 37,
                    "subject": "Introduction to the Mail Service",
                    "mailSN": 1,
                    "mimeSN": "1408951522.795266.30402.825668",
                    "from": {
                        "name": "Gildong Hong",
                        "email": "user01@example.com"
                    },
                    "toList": [
                        {
                            "name": "",
                            "email": "user01@example.com"
                        }
                    ],
                    "attachInfo": [],
                    "preview": "",
                    "receivedTime": 1408951522,
                    "attachCount": 0,
                    "folderSN": 101,
                    "folderName": null,
                    "toMe": false,
                    "securityLevel": "NORMAL",
                    "sentTime": 1408951522,
                    "iconType": 0,
                    "color": "#ffffff",
                    "reSend": true,
                    "spamType": null,
                    "unreadThreadCount": 0
                }
            ],
            "totalCount": 3,
            "listCount": 3,
            "unreadCount": 0,
            "pageSize": 30,
            "folderName": "All mailbox"
        },
        "returnMessage": "success"
    }
    

    It returns an error code and message when the API call fails (refer to "Response Common").

    Error Code Error Message Description
    999 Unknown Internal error