Veeam Backup for Microsoft Office 365 4.0
RESTful API Reference
Related documents

Sending, Saving, Copying and Restoring OneDrive Folders

Restores, sends, copies and saves backed up OneDrive folder with a specified ID.

Request

POST https://<hostname>:4443/v4/RestoreSessions/{restoreSessionId}/Organization/OneDrives/{oneDriveId}/Folders/{folderId}/Action

Request Headers

The request header must contain an authorization token of the current session.

Request Body

Restore to the original location

To restore a backed up OneDrive document to the 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.

UserPassword

string

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

DocumentVersion

DocumentVersion

Specifies, which of the following versions of the OneDrive documents 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 documents:

  • overwrite
  • keep

For example:

{

"restoretoOriginallocation":

 {"userName": "jsmith@westsupport.onmicrosoft.com",

  "userPassword": "paSSw0rd"

 }

}

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.

To

string

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

Subject

string

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

Text

string

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

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"

 }

}

Sending, Saving, Copying and Restoring OneDrive Folders Note:

To send attachments, you must specify VEOD email settings by sending PUT HTTPS request to the /VEODEmailSettings URL.

Copy to another OneDrive destination

To restore a backed up OneDrive document 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.

UserPassword

string

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

OneDrive

oneDrive

Specifies the target OneDrive copy destination.

Folder

folder

Specifies the target OneDrive folder copy destination.

ChangedItems

bool

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

DeletedItems

bool

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

RestorePermissions

bool

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

DocumentVersion

DocumentVersion

Specifies, which of the following versions of the OneDrive documents 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 documents on the destination server:

  • overwrite
  • merge

For example:

{

"copyTo":

 {

  "userName": "djohnes@northsupport.onmicrosoft.com",

  "userPassword": "paSSw0rd",

 

 }

}

Save

To save OneDrive folder, the request body must contain the save action:

{

 "save": null

}

The request command will place the folder to a temporary folder on the Veeam Backup for Microsoft Office 365 server. After that, the folder 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.

Sending, Saving, Copying and Restoring OneDrive Folders Tip:

You can use Swagger UI to download documents 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 a 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 and save actions: application/octet-stream.

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

Response Body

None.

Example 1

The following request sends OneDrive folders.

Request:

POST https://<hostname>:4443/v4/RestoreSessions/61954db6-7278-4d26-86f7-888bda5a4ec4/Organization/OneDrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/Folders/3dfb16ea-0dd1-43d0-becf-ee47713afb67/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 folder you requested"

 }

}

Response:

200 OK

Example 2

The following request saves OneDrive folder.

Request:

POST https://<hostname>:4443/v4/RestoreSessions/61954db6-7278-4d26-86f7-888bda5a4ec4/Organization/OneDrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/Folders/3dfb16ea-0dd1-43d0-becf-ee47713afb67/Action

 

Request Header:

Authorization: Bearer <Access-Token>

 

Request Body:

{

“Save” : null

}

Response:

200 OK

Example 3

The following request restores OneDrive folder.

Request:

POST https://<hostname>:4443/v4/RestoreSessions/61954db6-7278-4d26-86f7-888bda5a4ec4/Organization/OneDrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/Folders/3dfb16ea-0dd1-43d0-becf-ee47713afb67/Action

 

Request Header:

Authorization: Bearer <Access-Token>

 

Request Body:

{

 "restoretooriginallocation" :

 {

  "username" : "admin",

  "userpassword" : "12345678",

  "DocumentVersion" : "last",

  "DocumentAction" : "keep"

 }

}

 

Response:

200 OK

Example 4

The following request copies OneDrive folder.

Request:

POST https://<hostname>:4443/v4/RestoreSessions/61954db6-7278-4d26-86f7-888bda5a4ec4/Organization/OneDrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/Folders/3dfb16ea-0dd1-43d0-becf-ee47713afb67/Action

 

Request Header:

Authorization: Bearer <Access-Token>

 

Request Body:

{

 "copyto" :

 {

  "username" : "admin",

  "userpassword" : "12345678",

  "DocumentVersion" : "all",

  "folder" : "pictures",

  "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/v4/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/v4/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

This Document Help Center
User GuideRESTful API ReferencePowerShell ReferenceVeeam Explorers User GuideVeeam Explorers PowerShell Reference
I want to report a typo

There is a misspelling right here:

 

I want to let the Veeam Documentation Team know about that.