Restoring Mailbox Items to Another Mailbox
You can restore backed-up items to another mailbox.
The request header must contain an authorization token of the current session.
The following parameters must be specified in the URL of the request:
Specifies the identification number of the restore session. For more information on how to get this parameter, see Getting Restore Sessions.
Specifies the identification number of the mailbox. For more information on how to get this parameter, see Getting Mailboxes.
To restore backed-up items to a different mailbox on the production Exchange server, the request body must contain the following properties:
Specifies the email address of the mailbox to which you want to restore mailbox items.
Specifies the IDs of mailbox items that you want to restore. For more information on how to get such IDs, see Getting Mailbox Items.
Specifies the user name that you want to use for authenticating to the Exchange organization.
Specifies the password of the user account that you want to use for authenticating to the Exchange organization.
Specifies the authentication code. For more information on how to get a device code, see Getting Device Code.
This property is required if you want to use a device code for data restore.
Specifies the Microsoft Exchange server with Client Access Server (CAS) role. The mailbox items will be restored to a specified mailbox server.
Specifies the folder to which you want to restore mailbox items.
Specifies the region of the target Exchange organization. The following values are available:
Specifies the name of the target Exchange organization.
If set to true, indicates that all versions of mailbox items will be restored.
If set to true, indicates that deleted mailbox items will be restored.
If set to true, indicates that restored mailbox items will be marked as unread.
If set to true, indicates that Drafts mailbox folder will not be restored.
Example: "excludeDrafts": false.
If set to true, indicates that Deleted Items mailbox folder will not be restored.
Example: "excludeDeletedItems": false.
If set to true, indicates that preserved items of mailboxes placed on In-Place Hold will not be restored.
Example: "excludeInPlaceHoldItems": true.
If set to true, indicates that preserved items of mailboxes placed on Litigation Hold will not be restored.
Example: "excludeLitigationHoldItems": true.
An identification number of the Azure AD application that you want to use for a restore.
Specifies the SSL certificate configured for the Azure AD application that you want to use for data restore.
You must provide the certificate as a Base64 string. For more information on how to obtain a Base64 string, see Converting Certificate to Base64 String.
A password for the SSL certificate being used.
Specifies a user name of the account that will be used as a Microsoft Exchange account to restore backed-up mailbox items.
This property is required if you want to use an application certificate for data restore. Use this property only with the applicationCertificate property.
If you want to use a certificate to access an Azure AD application, you must provide the certificate as a Base64 string. To obtain a Base64 string, perform the following steps:
- Get the certificate content from a PFX file.
- Convert the certificate to a Base64 string.
To do this, you can use the following PowerShell cmdlets:
$pfx_cert = get-content '<path_to_cert>' -Encoding Byte
[System.Convert]::ToBase64String($pfx_cert) | Out-File '<path_to_file>'
- <path_to_cert> — path to the PFX file that you want to convert to a Base64 string.
- <path_to_file> — path to a file that that will contain the resulting Base64 string. You will be able to copy the Base64 string from the file and provide the string in the body of a request to Veeam Backup for Microsoft 365 REST API.
$pfx_cert = get-content 'C:\cert.pfx' -Encoding Byte
[System.Convert]::ToBase64String($pfx_cert) | Out-File 'C:\base64.txt'
The server returns the following response to the client.
A successfully completed operation returns response code 200 OK.
The response to this request contains the following headers. The response may also include additional standard HTTPS headers.
The length of the response body.
The media type and syntax of the response body message for the requests with the export and save actions: application/octet-stream.
The media type and syntax of the response body message for the requests with the restore and send actions: null.
In the response body, the server returns information about operation results.
The response body for the restore operation contains the following properties:
Number of missing items restored from the backup.
Number of changed items restored from the backup.
Number of items for which the restore operation failed.
Number of items that were not changed or missing in the original location. Such items are skipped during the restore operation.
The example shows how to restore all backed-up mailbox items to a different mailbox on the production Exchange server.
Authorization: Bearer <Access-Token>