Restores, sends, copies and saves backed up OneDrive documents.
Request
To perform actions with backed up OneDrive documents, send the POST HTTPS request to the URL of the /RestoreSessions/{ID}/Organization/OneDrives/{ID}/Documents/Action resource.
HTTPS Request
POST https://<Backup-Office365>:4443/v2/RestoreSessions/{ID}/Organization/OneDrives/{ID}/Documents/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 the original location
To restore 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. 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:
|
DocumentAction | DocumentAction | Specifies, which one of the following actions will be performed in case the restore destination contains the restored document:
|
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 documents 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. |
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 documenst on the destination server:
|
For example:
{ "copyTo": { "userName": "djohnes@northsupport.onmicrosoft.com", "userPassword": "paSSw0rd",
} } |
Save documents
To save OneDrive documents, the request body must contain the save action properties:
Property | Type | Description |
AsZip | bool | If set to True, indicates that the OneDrive documents will be saved in a Zip archive. For example, "asZip": "true". |
The request command will place documents to a temporary folder on the Veeam Backup for Microsoft Office 365 server. After that, documents 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 documents.
Request: POST https://<Backup-Office365>:4443/v2/RestoreSessions/61954db6-7278-4d26-86f7-888bda5a4ec4/Organization/OneDrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/Documents/Action
Request Header: Content-Type: application/json Authorization: Bearer <Access-Token>
Request Body: { "sendTo" : { "Documents" : [ { "size": 80101, "inheritedPermissions": true, "version": "1.0", "id": "0e4079a2-faa5-41bf-b8a7-ba883308cbc9", "name": "Content.jpg", "createdBy": "System Account", "creationTime": "2017-04-09T09:12:59", "modifiedBy": "System Account", "modificationTime": "2017-04-09T09:12:59", "_links": { "self": { "href": "https://support.north.local:4443/v2/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/documents/0e4079a2-faa5-41bf-b8a7-ba883308cbc9" }, "onedrive": { "href": "https://support.north.local:4443/v2/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39" }, "parent": { "href": "https://support.north.local:4443/v2/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/folders/89e2b52a-66e3-4a1a-a088-4655dfbe95d7" } } }, { "size": 1040384, "inheritedPermissions": true, "version": "2.0", "id": "206b13cc-a453-4102-a256-20a64f760e6d", "name": "nice_bakuretsu.png", "createdBy": "System Account", "creationTime": "2017-12-26T12:07:30", "modifiedBy": "System Account", "modificationTime": "2017-12-26T12:07:30", "_links": { "self": { "href": "https://support.north.local:4443/v2/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/documents/206b13cc-a453-4102-a256-20a64f760e6d" }, "onedrive": { "href": "https://support.north.local:4443/v2/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39" }, "parent": { "href": "https://support.north.local:4443/v2/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/folders/67cdafbf-8c14-434e-a02d-a04f228e0086" } } } ], "from": "fromUser@example.com", "to" : "toUser@example.com", "subject" : "Send document", "text" : "Hello. It’s your document!" } }
Response: 200 OK |
Example 2
The following request saves OneDrive documents.
Request: POST https://<Backup-Office365>:4443/v2/RestoreSessions/61954db6-7278-4d26-86f7-888bda5a4ec4/Organization/OneDrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/Documents/Action
Request Header: Content-Type: application/json Authorization: Bearer <Access-Token>
Request Body: { "save" : { "Documents" : [ { "size": 80101, "inheritedPermissions": true, "version": "1.0", "id": "0e4079a2-faa5-41bf-b8a7-ba883308cbc9", "name": "content.jpg", "createdBy": "System Account", "creationTime": "2017-04-09T09:12:59", "modifiedBy": "System Account", "modificationTime": "2017-04-09T09:12:59", "_links": { "self": { "href": "https://support.north.local:4443/v2/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/documents/0e4079a2-faa5-41bf-b8a7-ba883308cbc9" }, "onedrive": { "href": "https://support.north.local:4443/v2/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39" }, "parent": { "href": "https://support.north.local:4443/v2/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/folders/89e2b52a-66e3-4a1a-a088-4655dfbe95d7" } } }, { "size": 1040384, "inheritedPermissions": true, "version": "2.0", "id": "206b13cc-a453-4102-a256-20a64f760e6d", "name": "nice_bakuretsu.png", "createdBy": "System Account", "creationTime": "2017-12-26T12:07:30", "modifiedBy": "System Account", "modificationTime": "2017-12-26T12:07:30", "_links": { "self": { "href": "https://support.north.local:4443/v2/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/documents/206b13cc-a453-4102-a256-20a64f760e6d" }, "onedrive": { "href": "https://support.north.local:4443/v2/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39" }, "parent": { "href": "https://support.north.local:4443/v2/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/folders/67cdafbf-8c14-434e-a02d-a04f228e0086" } } } ] } }
Response: 200 OK |
Example 3
The following request restores OneDrive documents.
Request: POST https://<Backup-Office365>:4443/v2/RestoreSessions/61954db6-7278-4d26-86f7-888bda5a4ec4/Organization/OneDrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/Documents/Action
Request Header: Content-Type: application/json Authorization: Bearer <Access-Token>
Request Body: { "restoretooriginallocation" : { "Documents" : [ { "size": 80101, "inheritedPermissions": true, "version": "1.0", "id": "0e4079a2-faa5-41bf-b8a7-ba883308cbc9", "name": "content.jpg", "createdBy": "System Account", "creationTime": "2017-04-09T09:12:59", "modifiedBy": "System Account", "modificationTime": "2017-04-09T09:12:59", "_links": { "self": { "href": "https://support.north.local:4443/v2/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/documents/0e4079a2-faa5-41bf-b8a7-ba883308cbc9" }, "onedrive": { "href": "https://support.north.local:4443/v2/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39" }, "parent": { "href": "https://support.north.local:4443/v2/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/folders/89e2b52a-66e3-4a1a-a088-4655dfbe95d7" } } }, { "size": 1040384, "inheritedPermissions": true, "version": "2.0", "id": "206b13cc-a453-4102-a256-20a64f760e6d", "name": "nice_bakuretsu.png", "createdBy": "System Account", "creationTime": "2017-12-26T12:07:30", "modifiedBy": "System Account", "modificationTime": "2017-12-26T12:07:30", "_links": { "self": { "href": "https://support.north.local:4443/v2/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/documents/206b13cc-a453-4102-a256-20a64f760e6d" }, "onedrive": { "href": "https://support.north.local:4443/v2/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39" }, "parent": { "href": "https://support.north.local:4443/v2/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/folders/67cdafbf-8c14-434e-a02d-a04f228e0086" } } } ], "username" : "admin", "userpassword" : "12345678", "DocumentVersion" : "last", "DocumentAction" : "keep" } }
Response: 200 OK |
Example 4
The following request copies OneDrive documents.
Request: POST https://<Backup-Office365>:4443/v2/RestoreSessions/61954db6-7278-4d26-86f7-888bda5a4ec4/Organization/OneDrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/Documents/Action
Request Header: Content-Type: application/json Authorization: Bearer <Access-Token>
Request Body: { "copyto" : { "Documents" : [ { "size": 80101, "inheritedPermissions": true, "version": "1.0", "id": "0e4079a2-faa5-41bf-b8a7-ba883308cbc9", "name": "content.jpg", "createdBy": "System Account", "creationTime": "2017-04-09T09:12:59", "modifiedBy": "System Account", "modificationTime": "2017-04-09T09:12:59", "_links": { "self": { "href": "https://support.north.local:4443/v2/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/documents/0e4079a2-faa5-41bf-b8a7-ba883308cbc9" }, "onedrive": { "href": "https://support.north.local:4443/v2/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39" }, "parent": { "href": "https://support.north.local:4443/v2/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/folders/89e2b52a-66e3-4a1a-a088-4655dfbe95d7" } } }, { "size": 1040384, "inheritedPermissions": true, "version": "2.0", "id": "206b13cc-a453-4102-a256-20a64f760e6d", "name": "nice_bakuretsu.png", "createdBy": "System Account", "creationTime": "2017-12-26T12:07:30", "modifiedBy": "System Account", "modificationTime": "2017-12-26T12:07:30", "_links": { "self": { "href": "https://support.north.local:4443/v2/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/documents/206b13cc-a453-4102-a256-20a64f760e6d" }, "onedrive": { "href": "https://support.north.local:4443/v2/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39" }, "parent": { "href": "https://support.north.local:4443/v2/restoresessions/61954db6-7278-4d26-86f7-888bda5a4ec4/organization/onedrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/folders/67cdafbf-8c14-434e-a02d-a04f228e0086" } } } ], "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/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==" } } }
} }
Response: 200 OK |