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

(POST) /RestoreSessions/{ID}/Organization/Sites/{ID}/Libraries/{ID}/Action

Restores, sends and saves backed up SharePoint document library with a specified ID.

Request

To perform actions with a backed up SharePoint document library, send the POST HTTPS request to the URL of the /RestoreSessions/{ID}/Organization/Sites/{ID}/Libraries/{ID}/Action resource.

HTTPS Request

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

Request Headers

The request contains the following headers:

Header

Required

Description

Content-Type: application/json

true

Specifies the type of the content for your request.

Authorization: Bearer <Access-Token>

true

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

Request Body

Restore

To restore a SharePoint document library, the request body must contain the restoreTo 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 name you want to use for authenticating with the organization.

For example, "userPassword": "paSSw0rd".

List

string

Specifies the target SharePoint list.

ChangedItems

bool

If set to True, indicates that the SharePoint document library will be restored with all changed items.

For example, "changedItems": "true".

DeletedItems

bool

If set to True, indicates that the SharePoint document library will be restored with all deleted items.

For example, "deletedItems": "true".

RestorePermissions

bool

If set to True, indicates that the SharePoint documents will be restored with the backed up permissions.

For example, "restorePermissions": "true".

SendSharedLinksNotification

bool

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

For example, "sendSharedLinksNotification": "true"

RestoreListViews

bool

If set to True, indicates that the SharePoint lists will be restored with all list views.

For example, "restoreListViews": "true".

DocumentVersion

DocumentVersion

Specifies, which of the following versions of the SharePoint 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 SharePoint document on the destination list:

  • overwrite
  • merge

For example:

{

"restoreTo":

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

  "userPassword": "paSSw0rd",

  "list": "support_north",

  "changedItems": "True",

  "deletedItems": "True",

  "restorePermissions": "True",

  "restoreListviews": "True"

  "documentVersion": "last",

  "documentLastVersionAction": "overwrite"

 }

}

Send

To send a SharePoint document library as attachment in an email message, the request body must contain the sendTo action:

Property

Type

Description

From

string

Specifies the email address from which a restored library will be sent.

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

To

string

Specifies the email address to which a restored library will be sent.

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

Subject

string

Specifies the subject of the email message used for sending a restored library.

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

Text

string

Specifies the body of the email message used for sending a restored library.

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/Sites/{ID}/Libraries/{ID}/Action Note:

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

Save

To save a SharePoint document library, the request body must contain the save action:

{

 "save": null

}

The request command will place the document library to a temporary folder on the Veeam Backup for Microsoft Office 365 server. After that, the library 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/Sites/{ID}/Libraries/{ID}/Action Tip:

You can use Swagger UI to download the document library 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 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 restores SharePoint document libraries.

Request:

POST https://support.east.local:4443/v2/RestoreSessions/742fe5ac-3ea6-422b-b204-757b15a47e56/Organization/Sites/37ceec3f-565e-4ee0-9913-221c701d574401a462f8-4a26-4360-9296-04f489c34444/Libraries/37ceec3f-565e-4ee0-9913-221c701d574401a462f8-4a26-4360-9296-04f489c344441a867bcb-6a88-4744-adda-26c2c33e7cbb/Action

 

Request Header:

Content-Type: application/json

Authorization: Bearer <Access-Token>

 

Request Body:

{

 "restoreTo" :

 {

  "List" : "someList",

   "RestoreListViews" : true,

   "ChangedItems" : true,

   "DeletedItems" : true,

  "username" : "admin",

  "userpassword" : "password",

  "RestorePermissions" : true,

  "DocumentVersion" : "All"

 }

}

 

Response:

200 OK

Example 2

The following request saves SharePoint document libraries.

Request:

POST https://support.east.local:4443/v2/RestoreSessions/742fe5ac-3ea6-422b-b204-757b15a47e56/Organization/Sites/37ceec3f-565e-4ee0-9913-221c701d574401a462f8-4a26-4360-9296-04f489c34444/Libraries/37ceec3f-565e-4ee0-9913-221c701d574401a462f8-4a26-4360-9296-04f489c344441a867bcb-6a88-4744-adda-26c2c33e7cbb/Action

 

Request Header:

Content-Type: application/json

Authorization: Bearer <Access-Token>

 

Request Body:

{

 “save” : null

}

 

Response:

200 OK

Example 3

The following request sends SharePoint document libraries

Request:

POST https://support.east.local:4443/v2/RestoreSessions/742fe5ac-3ea6-422b-b204-757b15a47e56/Organization/Sites/37ceec3f-565e-4ee0-9913-221c701d574401a462f8-4a26-4360-9296-04f489c34444/Libraries/37ceec3f-565e-4ee0-9913-221c701d574401a462f8-4a26-4360-9296-04f489c344441a867bcb-6a88-4744-adda-26c2c33e7cbb/Action

 

Request Header:

Content-Type: application/json

Authorization: Bearer <Access-Token>

 

Request Body:

{

 "sendto" :

 {

  "from": "fromUser@example.com",

  "to" : "toUser@example.com",

  "subject" : "Send document",

  "text" : "Hello. It’s your document!"

 

 }

}

 

Response:

200 OK

Veeam Large Logo

User Guide

RESTful API Reference

PowerShell Reference