---
title: Search
slug: docuflow-guides/search
createdAt: 2022-01-04T21:19:17.000Z
---

Docuflow provides a web service endpoint that will allow you to retrieve a subset of documents/folders based on a search criteria. Docuflow supports two types of search within box. One using [metadata filters](https://developer.box.com/guides/search/metadata-filters/) and another using [metadata queries](https://developer.box.com/guides/metadata/queries/syntax/) (real-time).

You can learn about the pros and cons of which one to utilize [here](https://developer.box.com/guides/metadata/queries/comparison/).

To enable or disable metadata queries (real-time search) you can do so within the docuflow configurator interface.

::Image[]{src="https://api.archbee.com/api/optimize/1hH4CNQG9tP4YS-TB-TC6/Z6uyUXMcqCBMJvr8bwlAQ_image.png" size="74" width="1543" height="558" position="center" showCaption="false"}

We are providing below an example of both a metadata filter example (with search query disabled in the configurator), and a metadata query example (with search query enabled in the configurator).

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://localhost:82/scrud/search",
  "name": "Search (query)",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [
      {
        "kind": "required",
        "name": "cmsName",
        "type": "String",
        "description": "Name of the box system configured in docuflow."
      },
      {
        "kind": "required",
        "name": "whereClause",
        "type": "string",
        "description": "A where clause (JSON in string form). Used to query box to return a set of files/folders depending on criteria set."
      },
      {
        "kind": "required",
        "name": "selectedCMS",
        "type": "string",
        "description": "Value should always be set to \"box\" to let docuflow know which configured content system to search."
      }
    ],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "l7mAccvIkcMGyR03J3_aP",
        "code": "[\n\t{\n\t\t\"name\": \"check\",\n\t\t\"id\": \"895736641171\",\n\t\t\"type\": \"file\"\n\t},\n\t{\n\t\t\"name\": \"demo1.txt\",\n\t\t\"id\": \"897859484481\",\n\t\t\"type\": \"file\"\n\t}\n]",
        "language": "200"
      },
      {
        "id": "C0tj4vmrgrTV7Xq8ZvvAu",
        "code": "",
        "language": "500"
      }
    ],
    "selectedLanguageId": "l7mAccvIkcMGyR03J3_aP"
  },
  "examples": {
    "languages": [
      {
        "id": "RinXZo0WaAz3lEkUOH2ux",
        "code": "{\r\n   \"cmsName\":\"insertProductionSystemName (located in docuflow gui)\",\r\n   \"whereClause\":\"{\\\"from\\\":\\\"enterprise_InsertEnterpriseId.insertMetaDataTemplate\\\",\\\"query\\\":\\\"insertMetaDataColumnName = :value\\\",\\\"query_params\\\":{\\\"value\\\":\\\"insertMetaDataValue\\\"},\\\"ancestor_folder_id\\\":\\\"insertFolderId\\\"}\",\r\n   \"selectedCMS\":\"box\"\r\n}\r\n\r\n",
        "language": "json"
      }
    ],
    "selectedLanguageId": "RinXZo0WaAz3lEkUOH2ux"
  },
  "description": "Search for all documents using a where clause. If succesfull will return a JSON Array with a size greater then or equal to zero with status code of 200. Otherwise status code 500 is returned.\n\nPrecondition: insertName.searchQueryEnabled=true (located in inifile)",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "autoGeneratedAnchorSlug": "search-query",
  "legacyHash": "2I1lkUo-tBmvDr0MrlixB"
}
```
:::

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://localhost:82/scrud/search",
  "name": "Search (mdfilters)",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [
      {
        "kind": "required",
        "name": "cmsName",
        "type": "string",
        "description": "Name of the box system configured in docuflow."
      },
      {
        "kind": "optional",
        "name": "whereClause",
        "type": "string",
        "description": "A where clause (JSON in string form). Used to query box to return a set of files/folders depending on criteria set."
      },
      {
        "kind": "optional",
        "name": "selectedCMS",
        "type": "string",
        "description": "Value should always be set to \"box\" to let docuflow know which configured content system to search."
      }
    ],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "fGXdotBZMqjtdKDUmY0WT",
        "code": "[\n\t{\n\t\t\"name\": \"check\",\n\t\t\"id\": \"895736641171\",\n\t\t\"type\": \"file\"\n\t},\n\t{\n\t\t\"name\": \"demo1.txt\",\n\t\t\"id\": \"897859484481\",\n\t\t\"type\": \"file\"\n\t},\n\t{\n\t\t\"name\": \"Cataray.pdf\",\n\t\t\"id\": \"901051603311\",\n\t\t\"type\": \"file\"\n\t},\n\t{\n\t\t\"name\": \"Version3.pdf\",\n\t\t\"id\": \"901048740163\",\n\t\t\"type\": \"file\"\n\t},\n\t{\n\t\t\"name\": \"TEST XLS.xls\",\n\t\t\"id\": \"900741822394\",\n\t\t\"type\": \"file\"\n\t},\n\t{\n\t\t\"name\": \"TEST HTM.htm\",\n\t\t\"id\": \"900747633313\",\n\t\t\"type\": \"file\"\n\t},\n\t{\n\t\t\"name\": \"TEST GIF.gif\",\n\t\t\"id\": \"900747915499\",\n\t\t\"type\": \"file\"\n\t}\n]",
        "language": "200"
      },
      {
        "id": "J0Ifgft2wz-db1qWGif2B",
        "code": "",
        "language": "500"
      }
    ],
    "selectedLanguageId": "fGXdotBZMqjtdKDUmY0WT"
  },
  "examples": {
    "languages": [
      {
        "id": "jGF6SQdzbwLQ6_z9ZiwPF",
        "code": "{\r\n   \"cmsName\":\"insertProductionSystemName (located in docuflow gui)\",\r\n\t   \"whereClause\":\"mdfilters=[{\\\"templateKey\\\":\\\"insertMetaDataTemplateName\\\",\\\"scope\\\":\\\"enterprise\\\",\\\"filters\\\":{\\\"insertMetaDataColumnName\\\":\\\"insertMetaDataValue\\\"}}]\",\r\n   \"selectedCMS\":\"box\"\r\n}\r\n\r\n",
        "language": "json",
        "customLabel": "JSON"
      }
    ],
    "selectedLanguageId": "jGF6SQdzbwLQ6_z9ZiwPF"
  },
  "description": "Search for all files/folders using a where clause. If succesfull will return a JSON Array with a size greater then or equal to zero with status code of 200. Otherwise status code 500 is returned.",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "autoGeneratedAnchorSlug": "search-mdfilters",
  "legacyHash": "1XRHrMjsJLILx9kjnW4Vl"
}
```
:::



