Searching for OneDrive Items in OneDrives

You can search for items in backed-up organization OneDrives.

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 parameter 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.

The following optional parameter can be specified in the URL of the request:

Property

Type

Description

itemType

string

Specifies the type of the restore item. The following types are available:

  • All
  • Folders
  • Documents

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/9bd48e15-5138-4bbc-a030-e053ee2c311e/Organization/OneDrives/search?itemType=Folders

 

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

results

Results Object

Contains the Results object.

_links

Dictionary of string [key] and Object [value]

Links to related resources (navigation property).

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.

versionId

integer

Specifies the ID of the OneDrive item version.

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.

type

string

Specifies the type of the backed-up OneDrive folder. The following types are available:

  • ListFolder
  • LibraryFolder

title

string

Specifies the title 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,

 "totalCount": 0,

 "_links": {

   "self": {

     "href": "/v6/RestoreSessions/9bd48e15-5138-4bbc-a030-e053ee2c311e/Organization/OneDrives/search?itemtype=Folders&offset=0&limit=30&setid=7544fbde-6b6e-447e-b9cb-16aaefb44009"

   },

   "next": {

     "href": "/v6/RestoreSessions/9bd48e15-5138-4bbc-a030-e053ee2c311e/Organization/OneDrives/search?itemtype=Folders&offset=30&limit=30&setid=7544fbde-6b6e-447e-b9cb-16aaefb44009"

   }

 },

 "results": [

   {

     "id": "1fd5dde3-6fc1-448a-82ec-6a1fbaa5c694",

     "versionId": 1,

     "name": "RESTORED-folder2",

     "createdBy": "Administrator",

     "creationTime": "2021-06-30T11:13:01",

     "modifiedBy": "Administrator",

     "modificationTime": "2021-06-30T11:13:01",

     "_links": {

       "self": {

         "href": "/v6/restoresessions/9bd48e15-5138-4bbc-a030-e053ee2c311e/organization/onedrives/9c4a2afc-5e57-4dfa-a7e2-59e092691772ef4221af-9351-41ec-9128-534cf34db1a537d375da-1b9e-4ec2-90f5-8662275e3f1f1fd5dde3-6fc1-448a-82ec-6a1fbaa5c694/folders/1fd5dde3-6fc1-448a-82ec-6a1fbaa5c694"

       },

       "onedrive": {

         "href": "/v6/restoresessions/9bd48e15-5138-4bbc-a030-e053ee2c311e/organization/onedrives/9c4a2afc-5e57-4dfa-a7e2-59e092691772ef4221af-9351-41ec-9128-534cf34db1a537d375da-1b9e-4ec2-90f5-8662275e3f1f1fd5dde3-6fc1-448a-82ec-6a1fbaa5c694"

       },

       "folders": {

         "href": "/v6/restoresessions/9bd48e15-5138-4bbc-a030-e053ee2c311e/organization/onedrives/9c4a2afc-5e57-4dfa-a7e2-59e092691772ef4221af-9351-41ec-9128-534cf34db1a537d375da-1b9e-4ec2-90f5-8662275e3f1f1fd5dde3-6fc1-448a-82ec-6a1fbaa5c694/folders?parentId=1fd5dde3-6fc1-448a-82ec-6a1fbaa5c694"

       },

       "documents": {

         "href": "/v6/restoresessions/9bd48e15-5138-4bbc-a030-e053ee2c311e/organization/onedrives/9c4a2afc-5e57-4dfa-a7e2-59e092691772ef4221af-9351-41ec-9128-534cf34db1a537d375da-1b9e-4ec2-90f5-8662275e3f1f1fd5dde3-6fc1-448a-82ec-6a1fbaa5c694/documents?parentId=1fd5dde3-6fc1-448a-82ec-6a1fbaa5c694"

       },

       "versions": {

         "href": "/v6/restoresessions/9bd48e15-5138-4bbc-a030-e053ee2c311e/organization/onedrives/9c4a2afc-5e57-4dfa-a7e2-59e092691772ef4221af-9351-41ec-9128-534cf34db1a537d375da-1b9e-4ec2-90f5-8662275e3f1f1fd5dde3-6fc1-448a-82ec-6a1fbaa5c694/folders/1fd5dde3-6fc1-448a-82ec-6a1fbaa5c694/versions"

       }

     }

   },

   {

     "id": "631acaf6-4cc9-4ad7-9d40-355d2cbe6e46",

     "versionId": 1,

     "name": "RESTORED-folder22",

     "createdBy": "Administrator",

     "creationTime": "2021-06-30T11:15:12",

     "modifiedBy": "Administrator",

     "modificationTime": "2021-06-30T11:15:12",

     "_links": {

       "self": {

         "href": "/v6/restoresessions/9bd48e15-5138-4bbc-a030-e053ee2c311e/organization/onedrives/9c4a2afc-5e57-4dfa-a7e2-59e092691772ef4221af-9351-41ec-9128-534cf34db1a537d375da-1b9e-4ec2-90f5-8662275e3f1f631acaf6-4cc9-4ad7-9d40-355d2cbe6e46/folders/631acaf6-4cc9-4ad7-9d40-355d2cbe6e46"

       },

       "onedrive": {

         "href": "/v6/restoresessions/9bd48e15-5138-4bbc-a030-e053ee2c311e/organization/onedrives/9c4a2afc-5e57-4dfa-a7e2-59e092691772ef4221af-9351-41ec-9128-534cf34db1a537d375da-1b9e-4ec2-90f5-8662275e3f1f631acaf6-4cc9-4ad7-9d40-355d2cbe6e46"

       },

       "folders": {

         "href": "/v6/restoresessions/9bd48e15-5138-4bbc-a030-e053ee2c311e/organization/onedrives/9c4a2afc-5e57-4dfa-a7e2-59e092691772ef4221af-9351-41ec-9128-534cf34db1a537d375da-1b9e-4ec2-90f5-8662275e3f1f631acaf6-4cc9-4ad7-9d40-355d2cbe6e46/folders?parentId=631acaf6-4cc9-4ad7-9d40-355d2cbe6e46"

       },

       "documents": {

         "href": "/v6/restoresessions/9bd48e15-5138-4bbc-a030-e053ee2c311e/organization/onedrives/9c4a2afc-5e57-4dfa-a7e2-59e092691772ef4221af-9351-41ec-9128-534cf34db1a537d375da-1b9e-4ec2-90f5-8662275e3f1f631acaf6-4cc9-4ad7-9d40-355d2cbe6e46/documents?parentId=631acaf6-4cc9-4ad7-9d40-355d2cbe6e46"

       },

       "versions": {

         "href": "/v6/restoresessions/9bd48e15-5138-4bbc-a030-e053ee2c311e/organization/onedrives/9c4a2afc-5e57-4dfa-a7e2-59e092691772ef4221af-9351-41ec-9128-534cf34db1a537d375da-1b9e-4ec2-90f5-8662275e3f1f631acaf6-4cc9-4ad7-9d40-355d2cbe6e46/folders/631acaf6-4cc9-4ad7-9d40-355d2cbe6e46/versions"

       }

     }

   },

...

],

 "setId": "7544fbde-6b6e-447e-b9cb-16aaefb44009"

}