Search the persons, the assets and the shots by name. The query must have 3 characters or more. Else, the response is an empty object. The search uses the open projects that you can access. Give project_id to search one project only. If you cannot access this project, the asset and shot lists are empty. A client does not get persons. A user who is not an administrator gets the minimal fields of each person. A vendor gets only the entities of their tasks, without the hidden metadata columns.
Body
Required
-
Text to search, 3 characters or more
-
Search only this project
-
Maximum number of results for each index
Minimum value is
1. Default value is3. -
Number of results to skip in each index
Minimum value is
0. Default value is0. -
Indexes to search
Values are
assets,shots, orpersons. Default value is["assets", "shots", "persons"].
curl -X POST "http://api.example.com/data/search" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"query": "kitsu",
"project_id": "a24a6ea4-ce75-4665-a070-57453082c25",
"limit": 3,
"offset": 0,
"index_names": [
"assets"
]
}'
import requests
url = "http://api.example.com/data/search"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json"
}
params = {}
payload = {
"query": "kitsu",
"project_id": "a24a6ea4-ce75-4665-a070-57453082c25",
"limit": 3,
"offset": 0,
"index_names": [
"assets"
]
}
response = requests.post(
url,
headers=headers,
params=params,
json=payload
)
response.raise_for_status()
if response.content:
print(response.json())
{
"query": "chair",
"project_id": "a24a6ea4-ce75-4665-a070-57453082c250",
"limit": 3,
"offset": 0,
"index_names": [
"assets"
]
}
{
"persons": [
{
"id": "a24a6ea4-ce75-4665-a070-57453082c250",
"first_name": "John",
"last_name": "Doe"
}
],
"assets": [
{
"id": "b35b7fb5-df86-5776-b181-68564193d360",
"name": "Chair"
}
],
"shots": [
{
"id": "c46c80c6-e097-6887-c292-79675204e470",
"name": "SH010"
}
]
}