Skip to main content

Search by folder name

Overview​

There is no restriction on having two different folders with the same name. As such, if you are dynamically creating folders in your application, you need to be able to check whether the folder already exist or not. This API lets you search with the name of a folder and return the id and path of the matching folder.

Request structure​

POST https://dev.vdocipher.com/api/videos/folders/search

content-type: application/json
authorization: Apisecret _______

{
"name": "search query"
}

Input parameters​

Nameattributedescription
namestring (required)the search query upto 255 characters
searchExactboolean (optional) (default false)If false, it will search all folders starting with this text. If true, will only return exact matched folders.

Response​

{
"folders": [
{
"name": "search query and more text",
"id": "abcdef1234567890abcdef1234567890",
"folderPath": [
{
"id": "c84a81f7976441d395ac3a3fc135a5fe",
"name": "samples"
}
],
"createdAt": "2019-10-27T04:19:19.000Z"
}
]
}

Understanding the folder path​

The folder path is an array denoting the path to a folder. It contains an array of object with each object containing id and name.

For a folder at the top-level, this will be an empty array [].

For a folder which is located three or more levels deep. The folder is in reverse order of path. That means that if the structure is like below:

[
{
"id": "c84a81f7976441d395ac3a3fc135a5fe",
"name": "samples"
},
{
"id": "c84a81f7976441d395ac3a3fc135a5fe",
"name": "folder-sample"
}
]

Then the path of this folder is

/folder-sample/samples/

Sample Code​

The folder search query is written as __query__. The sample API Secret Key is a1b2c3d4e5.

curl -X POST "https://dev.vdocipher.com/api/videos/folders/search" \
-H 'content-type: application/json' \
-H 'Authorization: Apisecret a1b2c3d4e5' \
-d "{\"name\": \"__query__\"}"