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

Performing Restore on the Provider Side

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:

  1. Authenticate access to RESTful API resources.
  2. Get the ID of the Exchange organization.
  3. Get the ID of the Exchange organization's mailbox.
  4. Start a restore session.
  5. Explore mailbox backups.
  6. 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.

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"

}

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.

Response Body:

[

 {

   "type": "Office365",

   "id": "7b2b1ae1-7bbb-4651-b479-bda7edc7838b",

   "region": "worldwide",

   "name": "eastsupport.onmicrosoft.com",

   "username": "Admin@eastsupport.onmicrosoft.com",

   "isBackedup": "true",

   "firstBackuptime": "2017-05-14T09:17:45.8491057Z",

   "lastBackuptime": "2017-07-14T09:20:11.3371324Z",

   "_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 /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.

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"

       }

     }

   }

Start a Restore Session

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.

Performing Restore on the Provider Side Note:

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.

  • If you specify the point in time which precedes the organization's first backup time, the restore session will be created with no backup data for explore or restore.
  • If you specify the point in time which exceeds the organization's last backup time, the restore session will be created with backup data as of the latest restore point.

 

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.

Response Body:

{

 {

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

 "type": "Vex",

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

 "creationTime": "2017-06-29T07:42:21.191694Z",

 "state": "Working",

 "result": "Success",

 "_links": {

   ...

 }

}

Explore Mailbox Backups

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.

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 backups:

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 Provider 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