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

(POST) /RestoreSessions/{ID}/Organization/OneDrives/{ID}/Action

Sends, saves, copies and restores backed up OneDrive item with a specified ID.

Request

To restore, send, save or copy the backed up data from the organization's OneDrive item backup, send the POST HTTPS request to the URL of the /RestoreSessions/{ID}/Organization/OneDrives/{ID}/Action resource.

HTTPS Request

POST https://<Backup-Office365>:4443/v2/RestoreSessions/{ID}/Organization/OneDrives/{ID}/Action

Request Headers

The request header must contain the authorization token for the current logon session.

Request Body

Restore to the original location

To restore backed up OneDrive data to the same production server, the request body must contain the restoreToOriginalLocation action properties:

Property

Type

Description

UserName

string

Specifies the user name you want to use for authenticating with the organization.

For example, "userName": "jsmith@westsupport.onmicrosoft.com".

UserPassword

string

Specifies the user password you want to use for authenticating with the organization.

For example, "userPassword": "paSSw0rd".

DocumentVersion

DocumentVersion

Specifies, which of the following versions of the OneDrive document will be restored:

  • all
  • last

DocumentAction

DocumentAction

Specifies, which one of the following actions will be performed in case the restore destination contains the restored document:

  • overwrite
  • keep

For example:

{

 "restoreToOriginalLocation" :

 {

  "username" : "admin",

  "userpassword" : "12345678",

  "DocumentVersion" : "last",

  "documentAction" : "keep"

 }

}

 

Send as an email attachment

To send the backed up OneDrive data from a defined email address to a selected email, the request body must contain the sendTo action properties:

Property

Type

Description

From

string

Specifies the email address from which the attachments will be sent.

For example, "from": "j_smith@bestsupport.onmicrosoft.com".

To

string

Specifies the email address to which the attachments will be sent.

For example, "to": "r.clark@bestsupport.onmicrosoft.com".

Subject

string

Specifies the subject of the email message used for sending the attachments.

For example,  "subject": "Support Ticket".

Text

string

Specifies the body of the email message used for sending the attachments.

For example, "text": "Please find attached the files you requested".

For example:

{

 "sendTo":

 {"from": "j_smith@bestsupport.onmicrosoft.com",

  "to": "r.clark@bestsupport.onmicrosoft.com",

  "subject": "Support Ticket",

  "text": "Please find attached the files you requested"

 }

}

(POST) /RestoreSessions/{ID}/Organization/OneDrives/{ID}/Action Note:

To be able to send item attachments you must specify the VESP email settings by sending PUT HTTPS request to the /VESPEmailSettings URL. For more information, see (PUT) /VESPEmailSettings.

Copy to a different location

To restore backed up OneDrive data to a different production server, the request body must contain the copyTo action properties:

Property

Type

Description

UserName

string

Specifies the user name you want to use for authenticating with the organization.

For example, "userName": "jsmith@westsupport.onmicrosoft.com".

UserPassword

string

Specifies the user password you want to use for authenticating with the organization.

For example, "userPassword": "paSSw0rd".

ChangedItems

bool

If set to True, indicates that all versions of OneDrive items will be copied.

For example, "changedItems": "true".

DeletedItems

bool

If set to True, indicates that deleted OneDrive items will be copied.

For example, "deletedItems": "true".

RestorePermissions

bool

If set to True, indicates that the OneDrive items will be restored with all permissions.

For example, "restorePermissions": "true".

SendSharedLinksNotification

bool

If set to True, indicates that shared links notifications will be sent.

For example, "sendSharedLinksNotification": "true"

DocumentVersion

DocumentVersion

Specifies, which of the following versions of the OneDrive document will be restored:

  • all
  • last

DocumentLastVersionAction

DocumentLastVersionAction

Specifies, which one of the following actions will be performed with the last version of the restored OneDrive document on the production server:

  • overwrite
  • merge

For example:

{

 "copyTo" :

 {

  "username" : "admin",

  "userpassword" : "12345678",

  "DocumentVersion" : "last",

  "documentLastVersionAction" : "Merge",

  "folder" : "newFolder",

  "OneDrive" :

...

  ,

  "changedItems" : true,

  "deletedItems" : true,

  "restorePermissions" : true

 }

}

 

Save

To save a OneDrive item, the request body must contain the save action:

{

 "save": null

}

The request command will place the document to a temporary folder on the Veeam Backup for Microsoft Office 365 server. After that, the document will be transferred as application/octet-stream media to the client. To download, read or perform other actions with the octet-stream, use features of programming languages.

(POST) /RestoreSessions/{ID}/Organization/OneDrives/{ID}/Action Tip:

You can use Swagger UI to download the document from the stream by clicking Download action link in the response body.

Response

The server returns the following response to the client.

Response Codes

A successfully completed operation returns response code 200 OK.

Response Headers

The response to this request contains the following headers. The response may also include additional standard HTTPS headers.

Header

Description

Content-length

The length of the response body.

Content-type

The media type and syntax of the request body message for the requests with the export action: application/octet-stream.

The media type and syntax of the request body message for the requests with the restore actions: null.

Response Body

None.

Example 1

The following request restores backed up OneDrive item with a specified ID.

Request:

POST https://<Backup-Office365>:4443/v2/RestoreSessions/61954db6-7278-4d26-86f7-888bda5a4ec4/Organization/OneDrives/724011c3-a540-4684-b24f-3e2ab4ef6380df26ea7d-6468-4846-bdf5-4e88d871ed11/Action

 

Request Header:

Authorization: Bearer <Access-Token>

 

Request Body:

{

 "restoreToOriginalLocation" :

 {

  "username" : "admin",

  "userpassword" : "12345678",

  "DocumentVersion" : "last",

  "documentAction" : "keep"

 }

}

 

Response:

200 OK

Example 2

The following request copies backed up OneDrive item with a specified ID.

Request:

POST https://<Backup-Office365>:4443/v2/RestoreSessions/61954db6-7278-4d26-86f7-888bda5a4ec4/Organization/OneDrives/724011c3-a540-4684-b24f-3e2ab4ef6380df26ea7d-6468-4846-bdf5-4e88d871ed11/Action

 

Request Header:

Authorization: Bearer <Access-Token>

 

Request Body:

{

 "copyTo" :

 {

  "username" : "admin",

  "userpassword" : "12345678",

  "DocumentVersion" : "last",

  "documentLastVersionAction" : "Merge",

  "folder" : "newFolder",

  "OneDrive" :

   

   {

   "id": "724011c3-a540-4684-b24f-3e2ab4ef6380df26ea7d-6468-4846-bdf5-4e88d871ed11",

   "name": "CopyTo User",

   "url": "http://server/personal/orgUser",

   "_links": {

    "self": {

     "href": "https://support.north.local:4443/v2/organizations/a602e179-a821-4544-b653-f4aa03b39817/users/00000000-0000-0000-0000-000000000000d6d5c441-6c14-411a-9147-53f31a16d225AQUAAAAAAAUVAAAApgPzBIixQ2kafNW0dAQAAA==/onedrives/724011c3-a540-4684-b24f-3e2ab4ef6380df26ea7d-6468-4846-bdf5-4e88d871ed11"

    },

    "user": {

     "href": "https://support.north.local:4443/v2/organizations/a602e179-a821-4544-b653-f4aa03b39817/users/00000000-0000-0000-0000-000000000000d6d5c441-6c14-411a-9147-53f31a16d225AQUAAAAAAAUVAAAApgPzBIixQ2kafNW0dAQAAA=="

    }

   }

  }

 

  ,

  "changedItems" : true,

  "deletedItems" : true,

  "restorePermissions" : true

 }

}

 

Response:

200 OK

Example 3

The following request saves backed up OneDrive item with a specified ID.

Request:

POST https://<Backup-Office365>:4443/v2/RestoreSessions/61954db6-7278-4d26-86f7-888bda5a4ec4/Organization/OneDrives/724011c3-a540-4684-b24f-3e2ab4ef6380df26ea7d-6468-4846-bdf5-4e88d871ed11/Action

 

Request Header:

Authorization: Bearer <Access-Token>

 

Request Body:

{

 “save” : null

}

 

Response:

200 OK

Example 4

The following request sends backed up OneDrive item with a specified ID via email.

Request:

POST https://<Backup-Office365>:4443/v2/RestoreSessions/61954db6-7278-4d26-86f7-888bda5a4ec4/Organization/OneDrives/724011c3-a540-4684-b24f-3e2ab4ef6380df26ea7d-6468-4846-bdf5-4e88d871ed11/Action

 

Request Header:

Authorization: Bearer <Access-Token>

 

Request Body:

{

 "sendTo":

 {"from": "j_smith@bestsupport.onmicrosoft.com",

  "to": "r.clark@bestsupport.onmicrosoft.com",

  "subject": "Support Ticket",

  "text": "Please find attached the files you requested"

 }

}

Response:

200 OK

Veeam Large Logo

User Guide

RESTful API Reference

PowerShell Reference