Searching for OneDrive Items in OneDrives

In this article

    You can search for backed-up OneDrive items.

    Request

    POST https://<hostname>:4443/v6/RestoreSessions/{restoreSessionId}/Organization/OneDrives/search

    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 OneDrive Items.

    Request Body

    The request body must contain the following property:

    Property

    Type

    Description

    query

    string

    Specifies query parameters used to search for OneDrive items. For more information, see Query Parameters.

    Query Parameters

    The following table lists examples of parameters that you can use in the query string to search for Microsoft OneDrive for Business items.

    For the complete list of supported query parameters, see Appendix A. Item Search Parameters.

    Parameter

    Type

    Description

    filename

    string

    Specifies the name (or part of the name) of the file that you want to find.

    size

    string

    Specifies the size of the file that you want to find.

    Request Example

    Request:

    POST https://abc.tech.local:4443/v6/RestoreSessions/0cc8eff8-f20c-4130-8ed6-f492e16d2896/Organization/OneDrives/search

     

    Request Header:

    Authorization: Bearer <Access-Token>

     

    Request Body:

    {

      "query": "filename:default"

    }

     

    Searching for OneDrive Items in OneDrives Note

    If a value for a query parameter contains a space, provide the value in the quotation marks (""). Use the backslash (\) symbol as an escape character before these quotation marks. For example: "query": "filename: \"default properties\"".

    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

    The response body contains the following properties:

    Property

    Type

    Description

    offset

    integer

    Specifies the offset value.

    limit

    integer

    Specifies the limit of records to be displayed on the page.

    results

    Results Object

    Contains the Results object.

    Results Object

    Property

    Type

    Description

    sizeBytes

    string

    Specifies the size of the file in Bytes.

    inheritedPermissions

    boolean

    Defines whether file permissions are inherited from the parent folder.

    version

    string

    Specifies the version of the item.

    id

    string

    Specifies the item ID.

    name

    string

    Specifies the name of the item.

    createdBy

    string

    Specifies the name of the user who created the item.

    creationTime

    UTC

    Specifies the date and time when the item was created.

    modifiedBy

    string

    Specifies the name of the user who performed the latest modification of the item.

    modificationTime

    UTC

    Specifies the date and time of the latest modification of the item.

    _links

    Dictionary of string [key] and Object [value]

    Links to related resources (navigation property).

    Response Example

    Response:

    200 OK

     

    Response Body:

    {

     "offset": 0,

     "limit": 30,

     "results": [

       {

         "sizeBytes": 641494,

         "inheritedPermissions": true,

         "version": "1.0",

         "id": "4e005d91-8b3a-4c58-ad28-2bba2468889a",

         "name": "maxresdefault.jpg",

         "createdBy": "user_x",

         "creationTime": "2018-02-05T12:29:24",

         "modifiedBy": "admin8",

         "modificationTime": "2018-02-05T12:29:24",

         "_links": {

           "self": {

             "href": "v6/RestoreSessions/0cc8eff8-f20c-4130-8ed6-f492e16d2896/organization/onedrives/7a780e6e-46be-4735-b542-aa7c4758e53d4774e7df-5416-47d1-8f69-ae4d92e582e9/documents/4e005d91-8b3a-4c58-ad28-2bba2468889a"

           },

           "onedrive": {

             "href": "v6/RestoreSessions/0cc8eff8-f20c-4130-8ed6-f492e16d2896/organization/onedrives/7a780e6e-46be-4735-b542-aa7c4758e53d4774e7df-5416-47d1-8f69-ae4d92e582e9"

           },

           "parent": {

             "href": "v6/RestoreSessions/0cc8eff8-f20c-4130-8ed6-f492e16d2896/organization/onedrives/7a780e6e-46be-4735-b542-aa7c4758e53d4774e7df-5416-47d1-8f69-ae4d92e582e9/folders/770a460d-bfb6-49a6-92e2-c608e4cecca7"

           }

         }

       },

       {

         "sizeBytes": 641494,

         "inheritedPermissions": true,

         "version": "1.0",

         "id": "4195fe71-093f-486f-97fb-5959cd62aeee",

         "name": "maxresdefault.jpg",

         "createdBy": "user_x",

         "creationTime": "2018-02-05T12:29:24",

         "modifiedBy": "admin8",

         "modificationTime": "2018-02-05T12:29:24",

         "_links": {

           "self": {

             "href": "v6/RestoreSessions/0cc8eff8-f20c-4130-8ed6-f492e16d2896/organization/onedrives/7a780e6e-46be-4735-b542-aa7c4758e53d4774e7df-5416-47d1-8f69-ae4d92e582e9/documents/4195fe71-093f-486f-97fb-5959cd62aeee"

           },

           "onedrive": {

             "href": "v6/RestoreSessions/0cc8eff8-f20c-4130-8ed6-f492e16d2896/organization/onedrives/7a780e6e-46be-4735-b542-aa7c4758e53d4774e7df-5416-47d1-8f69-ae4d92e582e9"

           },

           "parent": {

             "href": "v6/RestoreSessions/0cc8eff8-f20c-4130-8ed6-f492e16d2896/organization/onedrives/7a780e6e-46be-4735-b542-aa7c4758e53d4774e7df-5416-47d1-8f69-ae4d92e582e9/folders/41f68803-038f-48b0-9b70-13129ee10d1f"

           }

         }

       }

     ],

     "_links": {

       "self": {

         "href": "v6/RestoreSessions/0cc8eff8-f20c-4130-8ed6-f492e16d2896/Organization/OneDrives/7a780e6e-46be-4735-b542-aa7c4758e53d4774e7df-5416-47d1-8f69-ae4d92e582e9/search?offset=0&limit=30"

       }

     }

    }