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

    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/{API ID}/mail/getFolderList

    HTTP Method

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

    Request

    No parameters.

    Request Example

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

    Response

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

    Property Type Required Description
    lastMailSN Integer Y The serial number of a last message
    Example) -1
    totalSizeMB Integer Y Total message usage (unit: MB)
    Example) 10
    totalUnreadMail Integer Y The number of unread messages
    Example) 10
    totalSize Long Y Total message usage (unit: byte)
    Example) 203107
    folderList List Y Returns a list of folders.
    usage List Y Specified folder usage (unit: byte)
    folderSN Integer Y Folder serial number
    folderType String Y Indicates whether it is a system folder or user-created folder.
    ● S: System folder
    ● U: User-created folder
    folderName String Y Folder name
    Example) Inbox
    unreadMailCount Integer Y The number of unread messages in the specified folder
    Example) 0
    mailCount Integer Y Total number of messages in the specified folder
    Example) 100
    parentFolderSN Integer Y The serial number of a primary hierarchy folder
    Example) 0
    folderDepth Integer Y Used only in the hierarchy folder. The default is 0 and it is incremented by 1.
    Example) 0
    folderOrder Integer Y The folder order to be displayed.
    Lower numbers imply that they should be displayed earlier (used only in the hierarchy folder).
    Example) 0
    hasChildFolder Integer Y Indicates whether a secondary hierarchy folder exists.
    ● 1: Exists
    ● 0: None

    Response Example

    {
        "message": "success",
        "data": {
            "lastMailSN": -1,
            "totalSizeMB": 0,
            "totalUnreadMail": -1,
            "folderList": [
                {
                    "usage": 0,
                    "folderSN": 0,
                    "folderType": "S",
                    "folderName": " Inbox",
                    "unreadMailCount": 0,
                    "mailCount": 0,
                    "parentFolderSN": 0,
                    "folderDepth": 0,
                    "folderOrder": 0,
                    "hasChildFolder": 0
                },
                {
                    "usage": 3655,
                    "folderSN": 1,
                    "folderType": "S",
                    "folderName": "Sent Mail",
                    "unreadMailCount": 0,
                    "mailCount": 3,
                    "parentFolderSN": 0,
                    "folderDepth": 0,
                    "folderOrder": 0,
                    "hasChildFolder": 0
                },
                {
                    "usage": 0,
                    "folderSN": 2,
                    "folderType": "S",
                    "folderName": "Mail Tracking",
                    "unreadMailCount": 0,
                    "mailCount": 3,
                    "parentFolderSN": 0,
                    "folderDepth": 0,
                    "folderOrder": 0,
                    "hasChildFolder": 0
                },
                {
                    "usage": 0,
                    "folderSN": 3,
                    "folderType": "S",
                    "folderName": "Temporary",
                    "unreadMailCount": 0,
                    "mailCount": 0,
                    "parentFolderSN": 0,
                    "folderDepth": 0,
                    "folderOrder": 0,
                    "hasChildFolder": 0
                },
                {
                    "usage": 0,
                    "folderSN": 4,
                    "folderType": "S",
                    "folderName": "Trash",
                    "unreadMailCount": 0,
                    "mailCount": 0,
                    "parentFolderSN": 0,
                    "folderDepth": 0,
                    "folderOrder": 0,
                    "hasChildFolder": 0
                },
                {
                    "usage": 0,
                    "folderSN": 5,
                    "folderType": "S",
                    "folderName": "Spam Mail",
                    "unreadMailCount": 0,
                    "mailCount": 0,
                    "parentFolderSN": 0,
                    "folderDepth": 0,
                    "folderOrder": 0,
                    "hasChildFolder": 0
                },
                {
                    "usage": 197373,
                    "folderSN": 6,
                    "folderType": "S",
                    "folderName": "Mail to Me",
                    "unreadMailCount": 0,
                    "mailCount": 2,
                    "parentFolderSN": 0,
                    "folderDepth": 0,
                    "folderOrder": 0,
                    "hasChildFolder": 0
                },
                {
                    "usage": 2079,
                    "folderSN": 101,
                    "folderType": "U",
                    "folderName": "Personal",
                    "unreadMailCount": 0,
                    "mailCount": 1,
                    "parentFolderSN": 0,
                    "folderDepth": 0,
                    "folderOrder": 0,
                    "hasChildFolder": 0
                }
            ],
            "totalSize": 203107
        },
        "code": "000"
    }
    

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

    Error Code Error Message Description
    101 FOLDER_NOT_EXIST The folder does not exist.
    999 SYSTEM_ERROR Internal error