restore_deleted_messages

The restore_deleted_messages method restores specific deleted messages.

To get a list of the messages that can be restored, use the get_deleted_messages method.

📘

Note:

If a message is deleted immediately after it is delivered, you may not be able to restore it.

Syntax

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

Request fields for restore_deleted_messages

The following fields can be used in the restore_deleted_messages method:

Field nameObligationDefinition/Value
idsRequiredThe IDs for the messages that you want to restore.

To get a list of the messages that can be restored, use the get_deleted_messages method.
userRequiredThe name of the mailbox.

Response fields for restore_deleted_messages

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

Field nameObligationDescription/Value
errorReturned if success = falseA text string that explains the error.
error_numberReturned if success = falseA number that represents the error.
idsReturned if success = trueContains a list of the messages and indicates whether each one was successfully restored or not.

Includes the following:

error—A text string that explains the error.

error_number—A number that represents the error.

id—The message id number.

success—Indicates whether this message was restored 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 restore_deleted_messages

Request

{
  "credentials": {
    "user": "[email protected]",
    "password": "sw0rdf1sh"
  },
  "user": "[email protected]",
  "ids":[
    "U2Fsd+ZoLG/DDD3l4dKu6D4eUOiuHvKz+T/nB//+Ga6UkJL1vOc/eHOgNznK", ]
}

Response

{
  "success": true,
  "ids": [
    {
      "success": true,
      "id": 
"U2Fsd+ZoLG/DDD3l4dKu6D4eUOiuHvKj+T/nB//+Ga6UkJL1vOc/eHOgNznK"
    }, 
  ]
}