(POST) /RestoreSessions/{restoreSessionId}/Organization/OneDrives/{oneDriveId}/Folders/Action
Restores, sends, copies and saves backed up OneDrive folders.
Request
To perform actions with backed up OneDrive folders, send the POST HTTPS request to the URL of the /RestoreSessions/{restoreSessionId}/Organization/OneDrives/{oneDriveId}/Folders/Action resource.
HTTPS Request
POST https://<Backup-Office365>:4443/v3/RestoreSessions/{restoreSessionId}/Organization/OneDrives/{oneDriveId}/Folders/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 folder 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. 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 documents will be restored:
|
DocumentAction | DocumentAction | Specifies, which one of the following actions will be performed in case the restore destination contains the restored documents:
|
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. 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" } } |
|
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 another OneDrive destination
To restore backed up OneDrive folders 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". |
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 the changed 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 documents will be restored:
|
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:
|
For example:
{ "copyTo": { "userName": "djohnes@northsupport.onmicrosoft.com", "userPassword": "paSSw0rd",
} } |
Save
To save backed up OneDrive folders, the request body must contain the save action:
{ "save": null } |
The request command will place folders to a temporary folder on the Veeam Backup for Microsoft Office 365 server. After that, the folders 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.
|
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 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://<Backup-Office365>:4443/v3/RestoreSessions/61954db6-7278-4d26-86f7-888bda5a4ec4/Organization/OneDrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/Folders/Action
Request Header: Authorization: Bearer <Access-Token>
Request Body: { "sendTo" : { “Folders”: [ { "id": "67cdafbf-8c14-434e-a02d-a04f228e0086", "name": "F2", "createdBy": "System Account", "creationTime": "2017-05-23T12:32:28", "modifiedBy": "System Account", "modificationTime": "2017-05-23T12:32:28", "_links": { "self": { "href": "https://support.north.local:4443/v3/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/folders/67cdafbf-8c14-434e-a02d-a04f228e0086" }, "onedrive": { "href": "https://support.north.local:4443/v3/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39" }, "parent": { "href": "https://support.north.local:4443/v3/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/folders/89e2b52a-66e3-4a1a-a088-4655dfbe95d7" }, "folders": { "href": "https://support.north.local:4443/v3/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/folders?parentId=67cdafbf-8c14-434e-a02d-a04f228e0086" }, "documents": { "href": "https://support.north.local:4443/v3/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/documents?parentId=67cdafbf-8c14-434e-a02d-a04f228e0086" } } } ], "from": "fromUser@example.com", "to" : "toUser@example.com", "subject" : "Send document", "text" : "Hello. It’s your folders!" } }
Response: 200 OK |
Example 2
The following request saves OneDrive folders.
Request: POST https://<Backup-Office365>:4443/v3/RestoreSessions/61954db6-7278-4d26-86f7-888bda5a4ec4/Organization/OneDrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/Folders/Action
Request Header: Authorization: Bearer <Access-Token>
Request Body: { "save" : { “Folders”: [ { "id": "67cdafbf-8c14-434e-a02d-a04f228e0086", "name": "F2", "createdBy": "System Account", "creationTime": "2017-05-23T12:32:28", "modifiedBy": "System Account", "modificationTime": "2017-05-23T12:32:28", "_links": { "self": { "href": "https://support.north.local:4443/v3/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/folders/67cdafbf-8c14-434e-a02d-a04f228e0086" }, "onedrive": { "href": "https://support.north.local:4443/v3/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39" }, "parent": { "href": "https://support.north.local:4443/v3/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/folders/89e2b52a-66e3-4a1a-a088-4655dfbe95d7" }, "folders": { "href": "https://support.north.local:4443/v3/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/folders?parentId=67cdafbf-8c14-434e-a02d-a04f228e0086" }, "documents": { "href": "https://support.north.local:4443/v3/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/documents?parentId=67cdafbf-8c14-434e-a02d-a04f228e0086" } } } ] } }
Response: 200 OK |
Example 3
The following request restores OneDrive folders.
Request: POST https://<Backup-Office365>:4443/v3/RestoreSessions/61954db6-7278-4d26-86f7-888bda5a4ec4/Organization/OneDrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/Folders/Action
Request Header: Authorization: Bearer <Access-Token>
Request Body: { "restoretooriginallocation" : { "folders" : [ { "id": "3dfb16ea-0dd1-43d0-becf-ee47713afb67", "name": "Shared with Everyone", "createdBy": "administrator", "creationTime": "2017-12-06T12:26:46", "modifiedBy": "administrator", "modificationTime": "2017-12-06T12:26:46", "_links": { "self": { "href": "https://support.north.local:4443/v3/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/folders/3dfb16ea-0dd1-43d0-becf-ee47713afb67" }, "onedrive": { "href": "https://support.north.local:4443/v3/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39" }, "folders": { "href": "https://support.north.local:4443/v3/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/folders?parentId=3dfb16ea-0dd1-43d0-becf-ee47713afb67" }, "documents": { "href": "https://support.north.local:4443/v3/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/documents?parentId=3dfb16ea-0dd1-43d0-becf-ee47713afb67" } } }
], "username" : "admin", "userpassword" : "12345678", "DocumentVersion" : "last", "DocumentAction" : "keep" } }
Response: 200 OK |
Example 4
The following request copies OneDrive folders.
Request: POST https://<Backup-Office365>:4443/v3/RestoreSessions/61954db6-7278-4d26-86f7-888bda5a4ec4/Organization/OneDrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/Folders/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/v3/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/v3/organizations/a602e179-a821-4544-b653-f4aa03b39817/users/00000000-0000-0000-0000-000000000000d6d5c441-6c14-411a-9147-53f31a16d225AQUAAAAAAAUVAAAApgPzBIixQ2kafNW0dAQAAA==" } } }, "ChangedItems" : true, "DeletedItems" : true, "RestorePermissions" : true, "Folders" : [ { "id": "3dfb16ea-0dd1-43d0-becf-ee47713afb67", "name": "Shared with Everyone", "createdBy": "administrator", "creationTime": "2017-12-06T12:26:46", "modifiedBy": "administrator", "modificationTime": "2017-12-06T12:26:46", "_links": { "self": { "href": "https://support.north.local:4443/v3/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/folders/3dfb16ea-0dd1-43d0-becf-ee47713afb67" }, "onedrive": { "href": "https://support.north.local:4443/v3/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39" }, "folders": { "href": "https://support.north.local:4443/v3/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/folders?parentId=3dfb16ea-0dd1-43d0-becf-ee47713afb67" }, "documents": { "href": "https://support.north.local:4443/v3/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/documents?parentId=3dfb16ea-0dd1-43d0-becf-ee47713afb67" } } }
]
}
}
Response: 200 OK |