In this page, you will learn how to restore Exchange organization's backed up mailbox items on the provider side.
A sample restore scenario requires performing the following steps:
- Authenticate access to RESTful API resources.
- Get the ID of the Exchange organization.
- Get the ID of the Exchange organization's mailbox.
- Start a restore session.
- Explore mailbox backups.
- Restore mailbox backups:
Authenticate Access to RESTful API Resources
To start working with Veeam Backup for Microsoft Office 365 RESTful API, you must authenticate yourself. To do that, send the POST HTTPS request to the Veeam Backup for Microsoft Office 365 token path. In the request body, enter user credentials for authenticating with the Veeam Backup for Microsoft Office 365 server.
Request: POST https://support.east.local:4443/v1/Token
Request Body: grant_type=password&username=tech\administrator&password=PassWord1 |
The server will return a pair of access and refresh tokens in the response body. Insert an access token in headers of further requests.
Get the ID of the Exchange Organization
Before exploring and restoring backed up items, make sure you have the ID of the Exchange organization. To get the ID, send the GET HTTPS request to the URL of the /Organizations resource.
Request: GET https://support.east.local:4443/v1/Organizations
Request Header: Authorization: Bearer <Access-Token> |
In the response body, the server will return a resource representation of all Exchange organizations added to Veeam Backup for Microsoft Office 365. Find the organization whose mailbox backups you want to restore. Copy the value of the Id property for later use.
Get the ID of the Exchange Organization's Mailbox
Before exploring and restoring backed up items, make sure you have the ID of the Exchange organization's mailbox. To get the ID, send the GET HTTPS request to the URL of the /Organizations/{ID}/Mailboxes resource. In the request, specify the Exchange organization's Id saved beforehand and the name of the mailbox with the ?name= query string.
Request: GET https://support.east.local:4443/v1/Organizations/7b2b1ae1-7bbb-4651-b479-bda7edc7838b/Mailboxes?name=*BillSommers*
Request Header: Authorization: Bearer <Access-Token> |
In the response body, the server will return a resource representation of the Exchange organization mailbox. Copy the value of the Id property for later use.
To explore the point-in-time state of mailbox backups and perform restore operations using RESTful API, you must first start a restore session. During a restore session Veeam Backup for Microsoft Office 365 uses Veeam Explorer for Microsoft Exchange functionality to explore and restore backups.
To start a restore session, send the POST HTTPS request to the URL of the /Organizations/{ID}/Action resource. In the request, specify the Exchange organization's Id saved beforehand. In the request body, for the datetime property specify the date and time to explore and restore mailbox items to the state as of that moment.
|
The firstBackuptime and the lastBackuptime Exchange organization's properties inform you when the organization's mailbox data was backed up for the first and last times.
|
Request: POST https://support.east.local:4443/v1/Organizations/7b2b1ae1-7bbb-4651-b479-bda7edc7838b/Action
Request Header: Authorization: Bearer <Access-Token>
Request Body: { "explore": {"datetime": "2017.06.26 18:00:00" } } |
In the response body, the server will return a resource representation of the restore session. Copy the value of the Id property for later use.
To explore backed up mailbox items, send the GET HTTPS request to the URL of the /RestoreSessions/{ID}/Organization/Mailboxes/{ID}/Items resource. In the request, specify the restore session ID and mailbox ID saved beforehand. To narrow down the item search, use the ?name= query string.
Request: GET https://support.east.local:4443/v1/RestoreSessions/0800471b-d0e2-422b-9d7c-35d15661c3fb/Organization/Mailboxes/f7a2aa8a-fb84-4444-9e98-ed04609bef45/Items?name=support*
Request Header: Authorization: Bearer <Access-Token> |
In the response body, the server will return a resource representation of backed up mailbox items. Save the IDs of the items you plan to restore for later use.
In this sample scenario you will learn how to perform the following restore operations for mailbox backups:
To export backed up mailbox items to PST files, send the POST HTTPS request to the URL of the /RestoreSessions/{ID}/Organization/Mailboxes/{ID}/Items/Action resource. In the request, specify the restore session ID and mailbox ID saved beforehand. In the request body, enter the exporttoPst action. Specify the contentKeywords property to query backed up mailbox items.
Request: POST https://support.east.local:4443/v1/RestoreSessions/0800471b-d0e2-422b-9d7c-35d15661c3fb/Organization/Mailboxes/f7a2aa8a-fb84-4444-9e98-ed04609bef45/Items/Action
Request Header: Authorization: Bearer <Access-Token>
Request Body: { "exporttoPst": {"contentKeywords": "support" } } |
The request command will look for the specified keyword in item names and fields inside the organization's mailbox. The backed up data containing the keyword then will be exported to a PST file and placed to a temporary folder on the Veeam Backup for Microsoft Office 365 server. After that, the PST file will be transferred as application/octet-stream media to the client. To download, read, convert to PST or perform other actions with the octet-stream, use features of programming languages.
|
You can use Swagger UI to download the octet-stream file by clicking the Download action link, which server returns in the response body after a successfully completed export operation. |
To restore backed up mailbox items to the same mailbox on the production server, send the POST HTTPS request to the URL of the /RestoreSessions/{ID}/Organization/Mailboxes/{ID}/Items/Action resource. In the request, specify the restore session ID and mailbox ID saved beforehand. In the request body, specify the restoretoOriginallocation action properties. For the items property, list the IDs of mailbox items you want to restore.
Request: POST https://support.east.local:4443/v1/RestoreSessions/0800471b-d0e2-422b-9d7c-35d15661c3fb/Organization/Mailboxes/f7a2aa8a-fb84-4444-9e98-ed04609bef45/Items/Action
Request Header: Authorization: Bearer <Access-Token>
Request Body: { "restoretoOriginallocation": {"userName": "jsmith@westsupport.onmicrosoft.com", "userPassword": "paSSw0rd" "items": [ {"Id": "AAAAAF4gCffLVmtL4dc3FKIFXGgHAKezhlHjipdOmVnvuPMPSwQAAAAAAVcAAKezhlHjipdOmVnvuPMPSwQAABTFetkAAA=="}, {"Id": "AAAAAF4gCffLVmtLqMPb9KIFXGgHAKezhlHjipdOmVnvuPMPSwQAAAAAAVcAAKezhlHjipdOmVnvuPMPSwQAABTFetgAAA=="}, {"Id": "AAAAAKGE4dIvQUtGjuSnq8JTHAgHAPliTMf_6DxPiJ6TGYB9CqAAAAAAAUcAAEJD8-NHTuNAoFrJGmIzcMoAAE-h_uoAAA=="} ] } |
A successfully completed restore operation request returns response code 200 OK.