move_user_messages

The move_user_messages method moves the specified user messages to a different folder.

Syntax

{
  <credentials object>
  "user": <mailbox_name>,
  "ids": [<list of message ids>] 
  "folder": <destination folder>
}

Request fields for move_user_messages

The following fields can be used in the move_user_messages method:

Field name

Obligation

Definition/Value

folder

Optional

The folder to search for messages. If not specified, the INBOX folder is searched.

ids

Required

The list of ids that you want to move.

The ids are returned by the get_user_messages method.

user

Required

The user's account name.

Response fields for move_user_messages

The following fields may be returned in response to the move_user_messages method:

Field name

Obligation

Description/Value

count

Returned if success = true

The number of messages returned in the messages list.

error

Returned if success = false

A text string that explains the error.

error_number

Returned if success = false

A number that represents the error.

ids

Returned if success = true

A list of hashes, one for each of the message ids submitted in the request. Includes the following information for each message listed:

  • error—A text string that explains the error.

  • error_number—A number that represents the error.

  • id—The id number of the message.

  • success—Indicates whether the message was moved successfully or not. Allowed values are true and false.

success

Always returned

Indicates whether the request was successful or not. Allowed values are true and false.

Examples for move_user_messages

Request

{
  "credentials": {
        "user": "[email protected]",
    "password": "pencil75"
  },
  "user": "[email protected]",
  "folder": "Spam",
  "ids": [
        "U2FsdGVkX1/1NoyVE6nnFbezjndojMCc+wKwHMv6al2buE2jNziDQTGzZUA7Gb0ivD u/6v0fJWAIrR2S0"
    ] 
}

Response

{
  "success": true,
  "ids": [
    {
      "success": true,
      "id": "U2FsdGVkX1/1NoyVE6nnFbezjndojMCc+wKwHMv6al2buE2jNziDQTGzZUA7Gb0ivDu/6v 0fJWAIrR2S0"
        } 
    ],
}