Get Folders

    Gets the complete list of folders in the mailbox for the logged-in user.

    API Type

    Service API

    Request URL

    https://apis.worksmobile.com/r/{API ID}/mail/v2/getFolderList

    HTTP Method

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

    Request

    No parameters.

    Response

    It returns HTTP status 200 with response data in JSON format if the API call is successful.

    Property Type Required Description
    lastMailSN Integer Y Serial number of the last message
    Example) 337
    totalSizeMB Integer Y Total size of messages (unit: MB)
    Example) 10
    totalUnreadMail Integer Y Number of unread messages
    Example) 10
    totalSize Long Y Total size of messages (unit: byte)
    Example) 203107
    vipMailBox Object N VIP folder information
    vipMailBox.vipList List N List of folders in the VIP folder
    vipMailBox.vipList[].lastReceivedTime Long N Received time of the last message in UNIX timestamp format
    Example) 1513206287
    vipMailBox.vipList[].name String N Folder name
    vipMailBox.vipList[].unreadMailCount Integer N Number of unread messages
    vipMailBox.vipList[].mailCount Integer N Total number of messages
    vipMailBox.vipList[].email String N Email address
    vipMailBox.totalUnreadMail Integer N Total number of unread messages in the VIP folder
    folderList List Y List of folders
    folderList[].usage Long Y Folder usage (unit: byte)
    folderList[].folderSN Integer Y Folder’s serial number
    folderList[].folderType String Y Indicates whether it is a system folder or user-created folder.
    ● S: System folder
    ● U: User-created folder
    (It is “S” for a user-created memo box.)
    folderList[].folderName String Y Folder name
    Example) Inbox
    folderList[].unreadMailCount Integer Y Number of unread messages in the specified folder
    Example) 0
    folderList[].mailCount Integer Y Total number of messages in the specified folder
    Example) 100
    folderList[].parentFolderSN Integer Y The serial number of a primary hierarchy folder
    Example) 0
    folderList[].folderDepth Integer Y Used only when folders are organized in hierarchy. It is 0 by default, and can be increased by 1.
    Example) 0
    folderList[].hasChildFolder Integer Y Indicates whether there is a sub folder.
    ● 1: There is a sub folder.
    ● 0: There is no sub folder.

    Response Example

    {
        "totalSize": 41564065,
        "vipMailBox": {
            "vipList": [{
                "lastReceivedTime": 1513206287,
                "name": "Test00",
                "unreadMailCount": 1,
                "mailCount": 1,
                "email": "api_test00@mail.wdomain8.com"
            }],
            "totalUnreadMail": 1
        },
        "lastMailSN": 337,
        "totalSizeMB": 39,
        "totalUnreadMail": 151,
        "humanReadable": "40MB",
        "folderList": [{
            "folderSN": 0,
            "folderType": "S",
            "folderName": "Inbox",
            "unreadMailCount": 151,
            "mailCount": 238,
            "usage": 33701530,
            "folderDepth": 0,
            "parentFolderSN": 0,
            "hasChildFolder": 0,
            "folderOrder": 0,
            "idomain": "N"
        }, {
            "folderSN": 1,
            "folderType": "S",
            "folderName": "Sent Mail",
            "unreadMailCount": 0,
            "mailCount": 62,
            "usage": 7443959,
            "folderDepth": 0,
            "parentFolderSN": 0,
            "hasChildFolder": 0,
            "folderOrder": 0,
            "idomain": "N"
        }, {
            "folderSN": 2,
            "folderType": "S",
            "folderName": "Tracking",
            "unreadMailCount": 0,
            "mailCount": 63,
            "usage": 0,
            "folderDepth": 0,
            "parentFolderSN": 0,
            "hasChildFolder": 0,
            "folderOrder": 0,
            "idomain": "N"
        }, {
            "folderSN": 3,
            "folderType": "S",
            "folderName": "Temporary",
            "unreadMailCount": 0,
            "mailCount": 13,
            "usage": 21890,
            "folderDepth": 0,
            "parentFolderSN": 0,
            "hasChildFolder": 0,
            "folderOrder": 0,
            "idomain": "N"
        }, {
            "folderSN": 4,
            "folderType": "S",
            "folderName": "Trash",
            "unreadMailCount": 5,
            "mailCount": 15,
            "usage": 396686,
            "folderDepth": 0,
            "parentFolderSN": 0,
            "hasChildFolder": 0,
            "folderOrder": 0,
            "idomain": "N"
        }, {
            "folderSN": 5,
            "folderType": "S",
            "folderName": "Spam Mail",
            "unreadMailCount": 0,
            "mailCount": 0,
            "usage": 0,
            "folderDepth": 0,
            "parentFolderSN": 0,
            "hasChildFolder": 0,
            "folderOrder": 0,
            "idomain": "N"
        }, {
            "folderSN": 6,
            "folderType": "S",
            "folderName": "Memo",
            "unreadMailCount": 0,
            "mailCount": 0,
            "usage": 0,
            "folderDepth": 0,
            "parentFolderSN": 0,
            "hasChildFolder": 0,
            "folderOrder": 0,
            "idomain": "N"
        }, {
            "folderSN": 102,
            "folderType": "U",
            "folderName": "For External Mail",
            "unreadMailCount": 0,
            "mailCount": 0,
            "usage": 0,
            "folderDepth": 0,
            "parentFolderSN": 0,
            "hasChildFolder": 0,
            "folderOrder": 0,
            "idomain": "N"
        }, {
            "folderSN": 101,
            "folderType": "U",
            "folderName": "Daum(Hanmail)",
            "unreadMailCount": 0,
            "mailCount": 0,
            "usage": 0,
            "folderDepth": 0,
            "parentFolderSN": 0,
            "hasChildFolder": 0,
            "folderOrder": 0,
            "idomain": "N"
        }]
    }
    

    Error

    It returns an error code and message with HTTP status when the API call fails.

    Property Type Description
    code String Error code
    message String Error message
    HTTP status Error code Description
    500 SYSTEM_ERROR Internal server error
    Error Example
    {
        "code": "SYSTEM_ERROR",
        "message": "internal error",
        "domain": "mail"
    }