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 nameObligationDefinition/Value
folderOptionalThe folder to search for messages. If not specified, the INBOX folder is searched.
idsRequiredThe list of ids that you want to move.

The ids are returned by the get_user_messages method.
userRequiredThe 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 nameObligationDescription/Value
countReturned if success = trueThe number of messages returned in the messages list.
errorReturned if success = falseA text string that explains the error.
error_numberReturned if success = falseA number that represents the error.
idsReturned if success = trueA 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.
successAlways returnedIndicates 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"
		} 
	],
}