restore_deleted_contacts

The restore_deleted_contacts method restores deleted contacts for a specified user.

To get a list of the contacts that can be restored, use the get_deleted_contacts method.

Syntax

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

Request fields for restore_deleted_contacts

The following fields can be used in the restore_deleted_contacts 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_contacts method.
userRequiredThe name of the mailbox.

Response fields for restore_deleted_contacts

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

Field nameObligationObligation/Value
errorReturned if success = falseA text string that explains the error.
A text string that explains the error.Returned if success = falseA number that represents the error.
idsReturned if success = trueContains a list of the contacts 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 contact id number.

success—Indicates whether this contact 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_contacts

This example tries to restore some deleted contacts for [email protected] - one that exists and one that does not.

Request

{
  "credentials": {
    "user": "[email protected]",
    "password": "pencil75"
  },
  "user": "[email protected]",
  "ids": [
    "1321909823__1321909700169",
    "1321909823__1321909700180"
  ]
}

Response

{
  "success": true,
  "ids": [
    {
      "success": true,
      "id": "1321909823__1321909700169"
		}, 
		{
			"success": false,
			"error_number": 2,
      "error": "The requested object does not exist",
      "id": "1321909823__1321909700180"
    }
	] 
}