This is an archive version of the document. To get the most up-to-date information, see the current version.

(POST) /RestoreSessions/{restoreSessionId}/Organization/OneDrives/{oneDriveId}/Documents/{documentId}/Action

In this article

    Restores, sends, copies and saves backed up OneDrive document.

    Request

    To perform actions with a backed up OneDrive document, send the POST HTTPS request to the URL of the /RestoreSessions/{ID}/Organization/OneDrives/{ID}/Documents/{ID}/Action resource.

    HTTPS Request

    POST https://<Backup-Office365>:4443/v3/RestoreSessions/{restoreSessionId}/Organization/OneDrives/{oneDriveId}/Documents/{documentId}/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 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.

    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": "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"

     }

    }

    (POST) /RestoreSessions/{restoreSessionId}/Organization/OneDrives/{oneDriveId}/Documents/{documentId}/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 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.

    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:

    • all
    • last

    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:

    • overwrite
    • merge

    For example:

    {

    "copyTo":

     {

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

      "userPassword": "paSSw0rd",

     

     }

    }

    Save documents

    To save a backed up OneDrive document, the request body must contain the save action properties:

    Property

    Type

    Description

    AsZip

    bool

    If set to True, indicates that the OneDrive document will be saved in a Zip archive.

    For example, "asZip": "true".

    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/{restoreSessionId}/Organization/OneDrives/{oneDriveId}/Documents/{documentId}/Action 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 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 OneDrive document.

    Request:

    POST https://<Backup-Office365>:4443/v3/RestoreSessions/61954db6-7278-4d26-86f7-888bda5a4ec4/Organization/OneDrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/Documents/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 OneDrive document.

    Request:

    POST https://<Backup-Office365>:4443/v3/RestoreSessions/61954db6-7278-4d26-86f7-888bda5a4ec4/Organization/OneDrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/Documents/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" : "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=="

        }

       }

      }

     

     }

    }

     

    Response:

    200 OK

    Example 3

    The following request saves OneDrive document.

    Request:

    POST https://<Backup-Office365>:4443/v3/RestoreSessions/61954db6-7278-4d26-86f7-888bda5a4ec4/Organization/OneDrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/Documents/724011c3-a540-4684-b24f-3e2ab4ef6380df26ea7d-6468-4846-bdf5-4e88d871ed11/Action

     

    Request Header:

    Authorization: Bearer <Access-Token>

     

    Request Body:

    {

    “save” :

    {

     “asZip” : “false”

    }

    }

     

    Response:

    200 OK

    Example 4

    The following request sends OneDrive document.

    Request:

    POST https://<Backup-Office365>:4443/v3/RestoreSessions/61954db6-7278-4d26-86f7-888bda5a4ec4/Organization/OneDrives/b3184e77-b95b-45f7-96cc-180a20b61cbd8507931c-4561-4ddf-bc90-411aba44bb39/Documents/724011c3-a540-4684-b24f-3e2ab4ef6380df26ea7d-6468-4846-bdf5-4e88d871ed11/Action

     

    Request Header:

    Authorization: Bearer <Access-Token>

     

    Request Body:

    {

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

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

      "subject" : "Send document",

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

    }

     

    Response:

    200 OK

    I want to report a typo

    There is a misspelling right here:

     

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