Help Center
Choose product document...
Veeam Backup for Microsoft Office 365
RESTful API Reference

Performing Restore on the Tenant Side

In this page, you will learn how to restore Exchange organization's backed up mailbox items on the tenant side.

A sample restore scenario requires performing the following steps:

  1. Authenticate access to RESTful API resources.
  2. Start a restore session.
  3. Get the ID of the Exchange organization's mailbox.
  4. Explore backed up mailbox items.
  5. Restore backed up mailbox items:

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 Exchange organization 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=abcsupport.onmicrosoft.com\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.

Response:

200 OK

 

Response Body:

{

 "access_token":"AQAAANCMnd8BFdERjHoAwE_Cl-sBAAAA5Ck8ocJ100Wyxh8hdKuiEwAAAAACAAAAAAAQZgAAAAEAACAAAABHCQCYPKfpXWKw_uoeoq20pNhKX-lyip5kdBIqDhiVsQAAAAAOgAAAAAIAACAAAABGFN15MbhZZ6I93ZR3gk1PCwpX7JodpsGaiXN2dXXlnsAAAACR9Ex4dJi6FQx6TL4_qJnn6UhGYoOcRboeojjMdLXnuce6wDr2_3aUfaJEpts0FUdrF_vZLSs7S_9pgtQJ1-ZrsjW4lomnLRdaN-EhCiLHKQ3N2cOylnNPv9Ycwrao5HDgT3ydfHF8BrMuCsvluuqizSSBGZyWRJmJbfyaSFQaVnxpqHlJCCSyogNLdmQGLKM-LmcBxsRvNP1qsRLRDeHniu9gyXWcpnZMjtOIpjkKCt603zl-4ha3H2wzn0k4JRdAAAAALal2CIHeK4bTmTSRfTI7xgV5MTYI7LFEGJBkG-LkYZuj6YD1lTq1WuPQ_Pkmf0WKRI_mwOmSB40LyJH0uk-cjA",

 "token_type":"bearer",

 "expires_in":60,

 "refresh_token":"AQAAANCMnd8BFdERjHoAwE_Cl-sBAAAA5Ck8ocJ100Wyxh8hdKuiEwAAAAACAAAAAAAQZgAAAAEAACAAAAAFXnoKO_LrlINdvNVDzqIeKB-opJRRyifnSGCCZN451gAAAAAOgAAAAAIAACAAAADBlvQhlBL_6WJUaOKTv2snGBxQFgr9sBDUwwvtAQx6J8AAAADQ8kWrxs7_2EpRX8pFejNzte1OSDvyU4WhyIKc7oKm5ja5KnqdVR778Ypi_fsCn4IBFbxlGFbLMDcUIRfH8UQCew3waMBYWg9WPyaMFOb0uBZTI1VAjEJEpHyehyaikKJdXOipeP8IoMVeQfLmJ-Jq_8OeLjIQSQEOqkgiImFXX2nu2HlgiXsYy9hA6t9_xek7nMY25X5_KQVobbnKBe0bkqb0OjenI3Pbrl8vgnyVem0kPsuDJtOTKnoPESzNqy9AAAAA6_NWQSQcujiwl-BWBfEZxdozsobU5H0bHWxM7WPYFdIwfjAeUIxvrpns4IXaE0z_VAnUYLOkT-ep-uiouWd_Jw",

 ".issued":"Thu, 30 August 2017 06:33:40 GMT",

 ".expires":"Fri, 30 August 2017 06:33:40 GMT"

}

 

Performing Restore on the Tenant Side Note:

To enable tenant authentication with Exchange organization credentials, a service provider must configure the authentication settings on the provider side. For more information, see the corresponding section of the Veeam Backup for Microsoft Office 365 User Guide at: helpcenter.veeam.com/docs/vbo365/guide/vbo_authentication.html.

Start a Restore Session

Each successful backup job run creates a restore point where the corresponding state of the mailbox datastore is kept. To explore the point-in-time state of backed up mailbox items 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 /RestoreSessions/Action resource. 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.

Request:

POST https://support.east.local:4443/v1/RestoreSessions/Action

 

Request Header:

Authorization: Bearer <Access-Token>

 

Request Body:

{

 "explore":

 {"datetime": "2017.08.30 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.

Response Body:

{

 {

 "id": "0800471b-d0e2-422b-9d7c-35d15661c3fb",

 "type": "Vex",

 "pointInTime": "2017-06-26T22:07:39-07:00",

 "creationTime": "2017-08-30T07:42:21.191694Z",

 "state": "Working",

 "result": "Success",

 "_links": {

   ...

 }

}

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 /RestoreSessions/{ID}/Organization/Mailboxes resource. In the request, specify the restore session's Id saved beforehand and the name of the mailbox with the ?name= query string.

Request:

GET https://support.east.local:4443/v1/RestoreSessions/0800471b-d0e2-422b-9d7c-35d15661c3fb/Organization/Mailboxes?name=*BillSommers*

 

Request Header:

Authorization: Bearer <Access-Token>

In the response body, the server will return a resource representation of the backed up Exchange organization mailbox. Copy the value of the Id property for later use.

Response Body:

{

 "offset": 0,

 "limit": 30,

 "results": [

   {

    "id": "f7a2aa8a-fb84-4444-9e98-ed04609bef45",

     "email": "bsommers@eastsupport.onmicrosoft.com",

     "name": "Bill Sommers",

     "isBackedup": "true",

     "_links": {

       "self": {

         "href": "https://support.east.local:4443/v1/Organizations/b2d9414d-c417-4a94-be3b-b38a3c2e8a7b/Mailboxes/f7a2aa8a-fb84-4444-9e98-ed04609bef45"

       },

       "organization": {

         "href": "https://support.east.local:4443/v1/Organizations/b2d9414d-c417-4a94-be3b-b38a3c2e8a7b"

       }

     }

   }

Explore Mailbox Backups

To explore the 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.

Response Body:

{

 "offset": 0,

 "limit": 30,

 "results": [

   {

     "from": "support_north",

     "cc": "",

     "bcc": "",

     "to": "qa_north",

     "sent": "2017-05-25T08:39:16.8235249Z",

     "received": "2017-05-25T08:39:16.8235249Z",

     "reminder": "false",

     "subject": "important",

     "_links": {

     ...

         }

       },

     "id": "AAAAAF4gCffLVmtLqMPb9KIFXGgHAKezhlHjipdOmVnvuPMPSwQAAAAAAVcAAKezhlHjipdOmVnvuPMPSwQAABTFetkAAA=="

   },

...]

Restore Mailbox Backups

In this sample scenario you will learn how to perform the following restore operations for mailbox items:

Export to PST Files

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.

Performing Restore on the Tenant Side Tip:

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.

Restore to the Same Mailbox

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.

Veeam Large Logo

User Guide

RESTful API Reference

PowerShell Reference