Search Folders or Files Under Specific Folder ID

get

/documents/api/1.2/folders/{folderId}/search/items

Search for a folder or file by fulltext or querytext in the specific folder ID or the self folder directory. This will search the entire directory tree under the specific folder ID or the self folder directory. This will also search shared folders. The search has a limit of 10000 items (folders and files).

Request

Supported Media Types
Path Parameters
  • Globally unique identifier (GUID) for the folder. If the referenced folder is the user's home folder, the value for folderId is self.

Query Parameters
  • Specify the additional fields to be returned. Currently, the only value supported is metadata, which would result in metadata associated with items returned by the search results being added to the response. The default is not to return metadata in the search results. In order to have metadata returned, use

    fields=metadata

  • Search string used to match folders or files. It will search these locations: itemName, contents, extension, ownerName, lastModifiedName, and folderDescription.

    Either fulltext or querytext must be provided in the search API.

  • Specify the maximum number of items to return. Use this parameter to specify how many items to include on a single page of results. The default is 20 and maximum is 10000. The following example limits the number of returned items to 10:

    limit=10

  • Specify the point at which to begin the list of items from the complete set of items returned for the action. If you do not specify an offset, the returned items begin with the first item in the item list (offset=0).

    Use this parameter to specify the starting point for a given page of results from the complete set of returned items. The following example limits the number of items per page to 10 and displays the second page of results (items 11-20):

    limit=10&offset=10

  • Order the resulting items using the specified field and sort order. You can use the name, size, lastModifiedName, and lastModifiedDate fields, and a sort order of ascending (asc) or descending (desc). For example, this is the default:

    orderby=name:asc

  • Search string used to search for folders or files using the targets listed below. It can replace fulltext, taking advantage of multiple targets at the same time.

    Either the fulltext or querytext parameter must be provided in the search API.

    The querytext parameter can target searches against the following string fields or number field. The search query is in the form:

    searchField<operation>searchValue

    Multiple searches can be combined with <AND> and <OR>. Searches are not case-sensitive.


    The following string fields are supported:
    • xTags: search for tags
    • fItemType: search by item type, either File to return only file items or Folder to return only folder items.
    • fItemName: search for an item's name.
      In the response this is the name field.
    • fCreator: search by the ID of the item's creator.
      In the response this is the createdBy.id field.
    • fCreatorFullName: search by the full display name of the item's creator.
      In the response this is the createdBy.displayName field.
    • fCreatorLoginName: search by the login name of the item's creator.
      In the response this is the createdBy.loginName field.
    • fOwner: search by the ID of the item's owner.
      In the response this is the ownedBy.id field.
    • fOwnerFullName: search by the full display name of the item's owner.
      In the response this is the ownedBy.displayName field.
    • fOwnerLoginName: search by the login name of the item's owner.
      In the response this is the ownedBy.loginName field.
    • fLastModifier: search by the ID of the user to last modify the item.
      In the response this is the modifiedBy.id field.
    • fLastModifierFullName: search by the full display name of the user to last modify the item.
      In the response this is the modifiedBy.displayName field.
    • fLastModifierLoginName: search by the login name of the user to last modify the item.
      In the response this is the modifiedBy.loginName field.
    • Searchable metadata fields can also be searched as string search targets, but metadata field values are not returned by the search. When you search by metadata fields, the target is MetadataCollectionName.metadataFieldName. For more information about metadata, see Metadata Collection REST Endpoints

    The string search supports <CONTAINS> and <MATCHES> operations.

    • <CONTAINS> operator instructs search to look for text fields being searched to contain specified "words". The words must be separated by tokens like whitespace and periods.
    • <MATCHES> operator instructs search to look for an exact (albeit, case-insensitive) match of the field value, including whitespaces and periods.


    The following date fields are supported:
    • fCreateDate: search by the created timestamp. Should be in the yyyy-mm-ddThh:mm:ssZ format, e.g. 2020-03-25T10:10:10Z.
      In the response this is the createdTime field.
    • fLastModifiedDate: search by the last modified timestamp. Should be in the yyyy-mm-ddThh:mm:ssZ format, e.g. 2020-03-25T10:10:10Z.
      In the response this is the modifiedTime field.
    • Searchable metadata fields can also be searched as date search targets, but metadata field values are not returned by the search. When you search by metadata fields, the target is MetadataCollectionName.metadataFieldName. For more information about metadata, see Metadata Collection REST Endpoints

    The following number field is supported:
    • dSize: search by the size in bytes of an item.

    The number and date search targets support the following operations.

    • Use < to search for values less that the search value.
    • Use = to search for values equal to the search value.
    • Use > to search for values greater than the search value.
    • Use <= to search for values less than or equal to the search value.
    • Use >= to search for values greater than or equal to the search value.

Header Parameters
  • Applink access token authorizing the current user to access this folder. This parameter is mandatory if appLinkID is used. It can be used as accessToken or AccessToken.

  • Applink ID authorizing the current user to access this folder. Any time the parameter appLinkID is used, a parameter accessToken must be provided as well. It can be used as appLinkID or AppLinkID.

  • Access code needed to use protected public links. It needs to be sent as part of a Cookie header in the following format: dAccessCode-<linkID>=<passcodeValue>

  • Public link ID of a public link authorizing the current user to access this folder. To work, this public link must have the contributor role granted. It can be used as linkID or LinkID.

Back to Top

Response

Supported Media Types

200 Response

The request was fulfilled.

Body ()
Root Schema : SearchSpecificFolderContents
Type: object
Show Source
Nested Schema : items
Type: array
The files and subfolders in the folder hierarchy.
Show Source
Nested Schema : FileAndSubFoldersItemsDefinition
Type: object
The files and subfolders in the folder.
Show Source
Nested Schema : User
Type: object
User information
Show Source
Example Response (application/json)
{
    "count":"2",
    "errorCode":"0",
    "offset":"1",
    "totalCount":"2",
    "items":[
        {
            "type":"file",
            "id":"DB4C832D0F144C0DD6310F451212FF6185DE5A6F9E67",
            "name":"textData13.txt",
            "parentID":"F9363F588099E137C5B2939E1212FF6185DE5A6F9E67",
            "createdTime":"2015-12-07T23:19:13Z",
            "modifiedTime":"2015-12-07T23:19:13Z",
            "createdBy":{
                "displayName":"User AA",
                "id":"U0EAA20910FAF3052ACB79E4T00000000001",
                "loginName":"userAALoginName",
                "type":"user"
            },
            "ownedBy":{
                "displayName":"User AA",
                "id":"U0EAA20910FAF3052ACB79E4T00000000001",
                "loginName":"userAALoginName",
                "type":"user"
            },
            "modifiedBy":{
                "displayName":"User AA",
                "id":"U0EAA20910FAF3052ACB79E4T00000000001",
                "loginName":"userAALoginName",
                "type":"user"
            },
            "metadata":{
                "items":[
                    {
                        "name":"MyMetaCollection",
                        "fields":{
                            "items":[
                                {
                                    "name":"IntField",
                                    "type":"integer",
                                    "value":"246"
                                },
                                {
                                    "name":"DateField",
                                    "type":"date",
                                    "value":"2019-02-22T17:03:00.000Z"
                                }
                            ]
                        }
                    }
                ]
            },
            "size":"38",
            "version":"1"
        },
        {
            "type":"file",
            "id":"D242D99558418023F547247DB5D17B95F470BB4C11B8",
            "name":"textData15.txt",
            "parentID":"F9363F588099E137C5B2939E1212FF6185DE5A6F9E67",
            "createdTime":"2015-12-09T20:51:53Z",
            "modifiedTime":"2015-12-09T20:51:53Z",
            "createdBy":{
                "displayName":"User AA",
                "id":"U0EAA20910FAF3052ACB79E4T00000000001",
                "loginName":"userAALoginName",
                "type":"user"
            },
            "ownedBy":{
                "displayName":"User AA",
                "id":"U0EAA20910FAF3052ACB79E4T00000000001",
                "loginName":"userAALoginName",
                "type":"user"
            },
            "modifiedBy":{
                "displayName":"User AA",
                "id":"U0EAA20910FAF3052ACB79E4T00000000001",
                "loginName":"userAALoginName",
                "type":"user"
            },
            "metadata":{
                "items":[
                ]
            },
            "size":"50"
        }
    ]
}

400 Response

Request parameters are not formatted correctly.

Back to Top

Examples

The following example searches for a folder or file by fulltext in a specific directory specified by a root folder ID. This can be a specific folder ID or the "self" folder. This search does not include shared folders even if the folder ID is self.

GET .../folders/F9363F588099E137C5B2939E1212FF6185DE5A6F9E67/search/items?fulltext=txt&orderby=modifiedTime:asc&limit=2&offset=1

Request Header

None.

Request Body

None.

HTTP Status Code

HTTP_STATUS = 200

JSON Response

{
    "count": "1",
    "errorCode": "0",
    "offset": "1",
    "totalCount": "1",
    "items": [
		{
            "type": "file",
            "id": "DB4C832D0F144C0DD6310F451212FF6185DE5A6F9E67",
            "name": "textData13.txt",
            "parentID": "F9363F588099E137C5B2939E1212FF6185DE5A6F9E67",
            "createdTime": "2015-12-07T23:19:13Z",
            "modifiedTime": "2015-12-07T23:19:13Z",
            "createdBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "ownedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "modifiedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "size": "38",
            "version": "1"
        }
    ]
}

Example 2

The following example searches for a folder or file using an invalid orderby sort field.

GET .../folders/F9363F588099E137C5B2939E1212FF6185DE5A6F9E67/search/items?fulltext=three&orderby=date

Request Header

None.

Request Body

None.

HTTP Status Code

HTTP_STATUS = 400

JSON Response

{
    "count": "0",
    "errorCode": "-96",
    "errorKey": "!csUnableToRetrieveSearchResults!csCloudOTSSearchInvalidSortField",
    "errorMessage": "Unable to retrieve search results. SortField is not valid.",
    "title": "Unable to retrieve search results. SortField is not valid.",
    "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}

Example 3

The following example searches for a folder or file using an invalid orderby sort order.

GET .../folders/F9363F588099E137C5B2939E1212FF6185DE5A6F9E67/search/items?fulltext=three&orderby=name:descending

Request Header

None.

Request Body

None.

HTTP Status Code

HTTP_STATUS = 400

JSON Response

{
    "count": "0",
    "errorCode": "-96",
    "errorKey": "!csUnableToRetrieveSearchResults!csSortOrderInvalid,descending",
    "errorMessage": "Unable to retrieve search results. Sort order 'descending' is invalid. Should be \"DESC\" or \"ASC\".",
    "title": "Unable to retrieve search results. Sort order 'descending' is invalid. Should be \"DESC\" or \"ASC\".",
    "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}

Example 4

The following example searches for a folder or file with no fulltext search criteria.

GET .../folders/F9363F588099E137C5B2939E1212FF6185DE5A6F9E67/search/items

Request Header

None.

Request Body

None.

HTTP Status Code

HTTP_STATUS = 400

JSON Response

{
    "count": "0",
    "errorCode": "-97",
    "errorKey": "!csUnableToRetrieveSearchResults!csSearchMissingQueryText",
    "errorMessage": "Unable to retrieve search results. QueryText is missing.",
    "title": "Unable to retrieve search results. QueryText is missing.",
    "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}

Example 5

The following example searches for a folder or file with an invalid limit.

GET .../folders/F9363F588099E137C5B2939E1212FF6185DE5A6F9E67/search/items?fulltext=test&orderby=size:asc&limit=0

Request Header

None.

Request Body

None.

HTTP Status Code

HTTP_STATUS = 400

JSON Response

{
    "count": "0",
    "errorCode": "-1",
    "errorKey": "!csUnableToRetrieveSearchResults!csSearchItemNotPositive,ResultCount",
    "errorMessage": "Unable to retrieve search results. ResultCount must be greater than 0.",
    "title": "Unable to retrieve search results. ResultCount must be greater than 0.",
    "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}

Example 6

The following example searches for a folder or file by fulltext in a specific directory specified by a root folder ID. This can be a specific folder ID or the "self" folder. This search does not include shared folders even if the folder ID is self. The example uses a public link ID because this folder is under a folder structure not owned by or shared with the current user.

GET .../folders/F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518/search/items?fulltext=txt&orderby=modifiedTime:asc&limit=2&offset=1

Request Header

LinkID: LF8D36FAFAB4388BECEAC4AEB5D17B95F47087F4E518

Request Body

None.

HTTP Status Code

HTTP_STATUS = 200

JSON Response

{
    "count": "2",
    "errorCode": "0",
    "offset": "1",
    "totalCount": "3",
    "items": [
        {
            "type": "file",
            "id": "DBEB2E535903F1EE642C08A4B5D17B95F47087F4E518",
            "name": "idcTestNewFileRESTNewNew.txt",
            "parentID": "F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518",
            "createdTime": "2016-07-01T00:24:38Z",
            "modifiedTime": "2016-07-01T00:24:38Z",
            "createdBy": {
                "displayName": "User BB",
                "loginName": "userBBLoginName",
                "id": "U0EBB20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "ownedBy": {
                "displayName": "User BB",
                "loginName": "userBBLoginName",
                "id": "U0EBB20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "modifiedBy": {
                "displayName": "User BB",
                "loginName": "userBBLoginName",
                "id": "U0EBB20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "size": "39",
            "version": "1"
        },
        {
            "type": "file",
            "id": "DBFC40982617C949CA373B08B5D17B95F47087F4E518",
            "name": "idcTestNewFile1KB.txt",
            "parentID": "F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518",
            "createdTime": "2016-06-27T22:47:34Z",
            "modifiedTime": "2016-07-06T23:39:08Z",
            "createdBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "ownedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "modifiedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "size": "33",
            "version": "9"
        }
    ]
}

Example 7

The following example searches for a folder or file by fulltext in a specific directory specified by a root folder ID. This can be a specific folder ID or the "self" folder. This search does not include shared folders even if the folder ID is self. The example uses a public link ID protected by an access code because this folder is under a folder structure not owned by or shared with the current user. An access code (test12345) is submitted as part of a Cookie in a request header.

GET .../folders/F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518/search/items?fulltext=txt&orderby=modifiedTime:asc&limit=2&offset=1

Request Header

LinkID: LF8D36FAFAB4388BECEAC4AEB5D17B95F47087F4E518
Cookie: dAccessCode-LF8D36FAFAB4388BECEAC4AEB5D17B95F47087F4E518=test12345

Request Body

None.

HTTP Status Code

HTTP_STATUS = 200

JSON Response

{
    "count": "2",
    "errorCode": "0",
    "offset": "1",
    "totalCount": "3",
    "items": [
        {
            "type": "file",
            "id": "DBEB2E535903F1EE642C08A4B5D17B95F47087F4E518",
            "name": "idcTestNewFileRESTNewNew.txt",
            "parentID": "F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518",
            "createdTime": "2016-07-01T00:24:38Z",
            "modifiedTime": "2016-07-01T00:24:38Z",
            "createdBy": {
                "displayName": "User BB",
                "loginName": "userBBLoginName",
                "id": "U0EBB20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "ownedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "modifiedBy": {
                "displayName": "User BB",
                "loginName": "userBBLoginName",
                "id": "U0EBB20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "size": "39",
            "version": "1"
        },
        {
            "type": "file",
            "id": "DBFC40982617C949CA373B08B5D17B95F47087F4E518",
            "name": "idcTestNewFile1KB.txt",
            "parentID": "F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518",
            "createdTime": "2016-06-27T22:47:34Z",
            "modifiedTime": "2016-07-06T23:39:08Z",
            "createdBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "ownedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "modifiedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "size": "33",
            "version": "9"
        }
    ]
}

Example 8

The following example requests a folder or file search by fulltext in a specific directory specified by a root folder ID. Because this folder is under a folder structure not owned by or shared with the current user, an access denied error message is returned.

GET .../folders/F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518/search/items?fulltext=txt&orderby=modifiedTime:asc&limit=2&offset=1

Request Header

None.

Request Body

None.

HTTP Status Code

HTTP_STATUS = 403

JSON Response

{
    "count": "0",
    "errorCode": "-20",
    "errorKey": "!csUnableToRetrieveSearchResults!csCloudItemInsufficientPrivileges,User BB,fFolderGUID:F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518,GET_SEARCH_RESULTS",
    "errorMessage": "Unable to retrieve search results. User 'User BB' has insufficient privilege to access fFolderGUID:F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518 with service GET_SEARCH_RESULTS.",
    "errorType": "folder",
    "id": "F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518",
    "limit": "2",
    "offset": "1",
    "querytext": "<ftx>txt</ftx>",
    "title": "Unable to retrieve search results. User 'User BB' has insufficient privilege to access fFolderGUID:F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518 with service GET_SEARCH_RESULTS.",
    "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}

Example 9

The following example requests a folder or file search by fulltext in a specific directory specified by a root folder ID. This folder is under a folder structure not owned or shared with the current user, and only a public link protected by an access code is available. An error is returned because the access code was not submitted as part of the request.

GET .../folders/F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518/search/items?fulltext=txt&orderby=modifiedTime:asc&limit=2&offset=1

Request Header

LinkID: LF8D36FAFAB4388BECEAC4AEB5D17B95F47087F4E518

Request Body

None.

HTTP Status Code

HTTP_STATUS = 403

JSON Response

{
    "count": "0",
    "errorCode": "-18",
    "errorKey": "!csUnableToRetrieveSearchResults!csAccessCodeRequiredForLinkAccess",
    "errorMessage": "Unable to retrieve search results. The access code must be provided to access the link.",
    "errorType": "folder",
    "id": "F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518",
    "limit": "2",
    "offset": "1",
    "querytext": "<ftx>txt</ftx>",
    "title": "Unable to retrieve search results. The access code must be provided to access the link.",
    "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}

Example 10

The following example searches for folders or files with a specific tag in a specific folder. This search includes the entire directory tree under the specified folder. The tag value must be delimited by an encoded value of ` represented by %60. This search does not include shared folders even if the folder ID is self.

GET .../folders/F9363F588099E137C5B2939E1212FF6185DE5A6F9E67/search/items?querytext=xtags<CONTAINS>%60personal%60

Request Header

None.

Request Body

None.

HTTP Status Code

HTTP_STATUS = 200

JSON Response

{
    "count": "2",
    "errorCode": "0",
    "offset": "0",
    "totalCount": "2",
    "items": [
        {
            "type": "folder",
            "id": "FF4321BD2656077C897A0E701212FF6185DE5A6F9E68",
            "name": "subFolderTest",
            "parentID": "F9363F588099E137C5B2939E1212FF6185DE5A6F9E67",
            "createdTime": "2015-12-09T20:51:53Z",
            "modifiedTime": "2015-12-09T20:51:53Z",
            "createdBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "ownedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "modifiedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "size": "-1"
        },
        {
            "type": "file",
            "id": "DB4C832D0F144C0DD6310F451212FF6185DE5A6F9E67",
            "name": "textData13.txt",
            "parentID": "F9363F588099E137C5B2939E1212FF6185DE5A6F9E67",
            "createdTime": "2015-12-07T23:19:13Z",
            "modifiedTime": "2015-12-07T23:19:13Z",
            "createdBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "ownedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "modifiedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "size": "38",
            "version": "1"
        }
    ]
}

Example 11

The following example searches for folders or files with a specific tag in a specific folder, using text file search at the same time. This search includes the entire directory tree under the specified folder. The tag value must be delimited by an encoded value of ` represented by %60. This search does not include shared folders even if the folder ID is self.

GET .../folders/F9363F588099E137C5B2939E1212FF6185DE5A6F9E67/search/items?querytext=xtags<CONTAINS>%60personal%60<AND><ftx>txt</ftx>

Request Header

None.

Request Body

None.

HTTP Status Code

HTTP_STATUS = 200

JSON Response

{
    "count": "1",
    "errorCode": "0",
    "offset": "0",
    "totalCount": "1",
    "items": [
        {
            "type": "file",
            "id": "DB4C832D0F144C0DD6310F451212FF6185DE5A6F9E67",
            "name": "textData13.txt",
            "parentID": "F9363F588099E137C5B2939E1212FF6185DE5A6F9E67",
            "createdTime": "2015-12-07T23:19:13Z",
            "modifiedTime": "2015-12-07T23:19:13Z",
            "createdBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "ownedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "modifiedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "size": "38",
            "version": "1"
        }
    ]
}

Example 12

The following example searches for folders or files with a specific metadata value. This search includes the entire directory tree under the specified folder. The metadata value must be delimited by an encoded value of ` represented by %60. This search does not include shared folders even if the folder ID is self.

GET .../folders/F454F4DE5EF397E880FFA186B5D17B95F47087F4E518/search/items?querytext=SearchableCollection.searchField1<CONTAINS>%60searchValue1%60

Request Header

None.

Request Body

None.

HTTP Status Code

HTTP_STATUS = 200

JSON Response

{
    "count": "5",
    "errorCode": "0",
    "offset": "0",
    "totalCount": "5",
    "items": [
        {
            "type": "folder",
            "id": "F454F4DE5EF397E880FFA186B5D17B95F47087F4E518",
            "name": "subFolder",
            "parentID": "FECEAA81A82C83700E64B43EB5D17B95F47087F4E518",
            "createdTime": "2016-10-10T13:54:09Z",
            "modifiedTime": "2016-10-10T13:54:09Z",
            "createdBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "ownedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "modifiedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "size": "-1"
        },
        {
            "type": "file",
            "id": "D93A34CA721F82C77031708DB5D17B95F47087F4E518",
            "name": "file4.txt",
            "parentID": "FECEAA81A82C83700E64B43EB5D17B95F47087F4E518",
            "createdTime": "2016-09-21T14:08:54Z",
            "modifiedTime": "2016-09-21T14:08:54Z",
            "createdBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "ownedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "modifiedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "size": "25",
            "version": "1"
        },
        {
            "type": "file",
            "id": "DCDBEBB4803B7EE48E4B073AB5D17B95F47087F4E518",
            "name": "file3.txt",
            "parentID": "FECEAA81A82C83700E64B43EB5D17B95F47087F4E518",
            "createdTime": "2016-09-21T14:08:13Z",
            "modifiedTime": "2016-09-21T14:08:13Z",
            "createdBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "ownedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "modifiedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "size": "25",
            "version": "1"
        },
        {
            "type": "file",
            "id": "D8E8B2ABABAA0E42D3E4964CB5D17B95F47087F4E518",
            "name": "file2.txt",
            "parentID": "FECEAA81A82C83700E64B43EB5D17B95F47087F4E518",
            "createdTime": "2016-09-21T14:08:00Z",
            "modifiedTime": "2016-09-21T14:08:00Z",
            "createdBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "ownedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "modifiedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "size": "25",
            "version": "1"
        },
        {
            "type": "file",
            "id": "D1A21D80F7FDD74E9FD93695B5D17B95F47087F4E518",
            "name": "file1.txt",
            "parentID": "FECEAA81A82C83700E64B43EB5D17B95F47087F4E518",
            "createdTime": "2016-09-21T14:07:06Z",
            "modifiedTime": "2016-09-21T14:07:06Z",
            "createdBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "ownedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "modifiedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "size": "25",
            "version": "1"
        }
    ]
}

Example 13

The following example searches for a folder or file by fulltext in a specific directory specified by a root folder ID. This search does not include shared folders. The example uses an applink ID because this folder is under a folder structure not owned by or shared with the current user. The applink ID and access token are submitted in the request header.

GET .../folders/FAD7A87F0613A0CBDD4DA521B5D17B95F47087F4E518/search/items?fulltext=subFolderTestByUserB&orderby=modifiedTime:asc

Request Header

appLinkID: LF5Bxj4TPo_p4n4qWn0tbKTicR2cTUJKv7X_ng9E7ry93rRuDokPqS1d6-wKwhb_wtcGYFDsI_cNMxeKQ-HR-FXQhiVoGRTYM_MPZY8qpICfYU94mmnMjM_cvsRhKMzc0NJgvwEJfqqDwPsAVrhc8cmg==
accessToken: 352FpiMmW66PeYI1Gh5b83I9CXRwZhLfYAu4TXdqpzD8uNKUBMZVVJ3ZvivUW8kQ

Request Body

None.

HTTP Status Code

HTTP_STATUS = 200

JSON Response

{
    "count": "2",
    "errorCode": "0",
    "offset": "0",
    "totalCount": "2",
    "items": [
        {
            "type": "folder",
            "id": "F62E96098A6F9186F94730C1B5D17B95F47087F4E518",
            "name": "subFolderTestByUserB(2)",
            "parentID": "F64529EF770DCF96F029ED82B5D17B95F47087F4E518",
            "createdTime": "2017-06-16T20:37:03Z",
            "modifiedTime": "2017-06-16T20:45:01Z",
            "createdBy": {
                "displayName": "User BB",
                "id": "U5083EA1954687218BA6C3D9B5D17B95F470",
                "loginName": "U5083EA1954687218BA6C3D9B5D17B95F470",
                "type": "user"
            },
            "ownedBy": {
                "displayName": "User AA",
                "id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
                "loginName": "userAALoginName",
                "type": "user"
            },
            "modifiedBy": {
                "displayName": "User BB",
                "id": "U5083EA1954687218BA6C3D9B5D17B95F470",
                "loginName": "U5083EA1954687218BA6C3D9B5D17B95F470",
                "type": "user"
            },
            "size": "-1",
            "description": "subFolderTestByUserB CONTRIBUTOR applink - EDITED"
        },
        {
            "type": "folder",
            "id": "F64529EF770DCF96F029ED82B5D17B95F47087F4E518",
            "name": "subFolderTestByUserB",
            "parentID": "FAD7A87F0613A0CBDD4DA521B5D17B95F47087F4E518",
            "createdTime": "2017-06-16T18:10:05Z",
            "modifiedTime": "2017-06-19T20:11:33Z",
            "createdBy": {
                "displayName": "User BB",
                "id": "U5083EA1954687218BA6C3D9B5D17B95F470",
                "loginName": "U5083EA1954687218BA6C3D9B5D17B95F470",
                "type": "user"
            },
            "ownedBy": {
                "displayName": "User AA",
                "id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
                "loginName": "userAALoginName",
                "type": "user"
            },
            "modifiedBy": {
                "displayName": "User BB",
                "id": "U5083EA1954687218BA6C3D9B5D17B95F470",
                "loginName": "U5083EA1954687218BA6C3D9B5D17B95F470",
                "type": "user"
            },
            "size": "-1",
            "description": "subFolderTestByUserB CONTRIBUTOR applink - EDITED"
        }
    ]
}
Back to Top