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

    Delete Messages

    Deletes the specific message permanently or moves it to Trash.

    API Type

    Service API

    Request URL

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

    HTTP Method

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

    Request

    Parameter Type Required Description
    mailSNList String Y A value that contains a list of serial numbers for messages to be deleted; each number is separated by a semicolon (;).
    In Thread View, "c" should be added before the serial number upon request if the "threadCount" value is greater than 1.
    Example) 46554;46548;c46550
    deleteSpamDirect Integer N Used only in Spam Mail
    ● -1 (default): Not required
    ● 0: Moves
    ● 1: Deletes permanently
    currentFolderType String N Folder type
    ● spam: Spam Mail
    ● trash: Trash
    ● search: Search result
    ● etc: etc.
    folderSNList String N A value that contains a list of serial numbers for corresponding messages; each number is separated by a semicolon (;).
    It can be used if the "currentFolderType" value is search.
    Example) 0;1

    Request Example

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

    Response

    It indicates whether the request was successful or not, and returns the "data" value having an empty string.

    Property Type Required Description
    message Long Y Indicates whether successful or not.
    ● Success: "success"
    ● Failure: Error code
    code Integer Y Code that indicates whether successful or not.
    ● Success: "000"
    ● Failure: Any integer excluding "000"
    data Integer N null

    Response Example

    {"message":"success","data":"","code":"000"}
    

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

    Error Code Error Message Description
    100 folderSNList parameter is null The "currentFolderType" value is search and the "folderSNList" value does not exist.
    999 SYSTEM_ERROR Internal error