Getting All Versions of OneDrive Folder

In this article

    You can get a resource representation of versions of a backed-up OneDrive folder with the specified ID.

    When you get OneDrive folder versions, the server returns information about previous versions of the folder. To get the latest version, use either Getting OneDrive Folders or Getting Specific Version of OneDrive Folder operation.

    Request

    GET https://<hostname>:4443/v6/RestoreSessions/{restoreSessionId}/Organization/OneDrives/{oneDriveId}/Folders/{folderId}/Versions

    Request Headers

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

    Request Parameters

    The following parameters must be specified in the URL of the request:

    Parameter

    Type

    Description

    restoreSessionId

    string

    Specifies the identification number of the restore session. For more information on how to get this parameter, see Getting Restore Sessions.

    oneDriveId

    string

    Specifies the identification number of OneDrive. For more information on how to get this parameter, see Getting OneDrives.

    folderId

    string

    Specifies the identification number of the OneDrive folder. For more information on how to get this parameter, see Getting OneDrive Folders.

    Request Body

    None.

    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 response body message: application/json; charset=utf-8

    Response Body

    In the response body, the server returns a resource representation of the /RestoreSessions/{restoreSessionId}/Organization/OneDrives/{oneDriveId}/Folders/{folderId}/Versions collection resource.

    Example

    The example returns a resource representation of versions of the OneDrive folder with the ID 9bad4ae7-1dc4-4206-a76f-9b9da8a0d96a.

    Request:

    GET https://abc.tech.local:4443/v6/RestoreSessions/2d09a351-3c1f-4943-a95c-5fa550ddef2f/Organization/OneDrives/7a780e6e-46be-4735-b542-aa7c4758e53d4774e7df-5416-47d1-8f69-ae4d92e582e9/Folders/9bad4ae7-1dc4-4206-a76f-9b9da8a0d96a/Versions

     

    Request Header:

    Authorization: Bearer <Access-Token>

     

    Response:

    200 OK

     

    Response Body:

    {

     "offset": 0,

     "limit": 30,

     "_links": {

       "self": {

         "href": "/v6/RestoreSessions/2d09a351-3c1f-4943-a95c-5fa550ddef2f/Organization/OneDrives/7a780e6e-46be-4735-b542-aa7c4758e53d4774e7df-5416-47d1-8f69-ae4d92e582e9/folders/9bad4ae7-1dc4-4206-a76f-9b9da8a0d96a/Versions?offset=0&limit=30"

       }

     },

     "results": [

       {

         "version": "1.0",

         "id": "9bad4ae7-1dc4-4206-a76f-9b9da8a0d96a",

         "versionId": 2,

         "name": "new",

         "createdBy": "admin8",

         "creationTime": "2022-07-02T18:10:57Z",

         "modifiedBy": "admin8",

         "modificationTime": "2022-07-02T18:23:11Z",

         "_links": {

           "self": {

             "href": "/v6/restoresessions/2d09a351-3c1f-4943-a95c-5fa550ddef2f/organization/onedrives/7a780e6e-46be-4735-b542-aa7c4758e53d4774e7df-5416-47d1-8f69-ae4d92e582e9/folders/9bad4ae7-1dc4-4206-a76f-9b9da8a0d96a/versions/2"

           },

           "onedrive": {

             "href": "/v6/restoresessions/2d09a351-3c1f-4943-a95c-5fa550ddef2f/organization/onedrives/7a780e6e-46be-4735-b542-aa7c4758e53d4774e7df-5416-47d1-8f69-ae4d92e582e9"

           },

           "folders": {

             "href": "/v6/restoresessions/2d09a351-3c1f-4943-a95c-5fa550ddef2f/organization/onedrives/7a780e6e-46be-4735-b542-aa7c4758e53d4774e7df-5416-47d1-8f69-ae4d92e582e9/folders?parentId=9bad4ae7-1dc4-4206-a76f-9b9da8a0d96a"

           },

           "documents": {

             "href": "/v6/restoresessions/2d09a351-3c1f-4943-a95c-5fa550ddef2f/organization/onedrives/7a780e6e-46be-4735-b542-aa7c4758e53d4774e7df-5416-47d1-8f69-ae4d92e582e9/documents?parentId=9bad4ae7-1dc4-4206-a76f-9b9da8a0d96a"

           }

         }

       },

    ...

     ],

     "setId": "00000000-0000-0000-0000-000000000000"

    }