post https://api.safetyculture.io/directory/v1/folders/search
When searching folders you have the ability to search for all folders (country
,state
,region
,area
,location
) or just leaf_nodes (locations
).
Examples
Search first 100 folder items
curl -X POST "https://api.safetyculture.io/directory/v1/folders/search" \
-H "Authorization: Bearer {api_token}" \
-d '{
"query": "221 Sturt St",
"limit": 100
}'
Search next 100 folder items
curl -X POST "https://api.safetyculture.io/directory/v1/folders/search" \
-H "Authorization: Bearer {api_token}" \
-d '{
"query": "221 Sturt St",
"limit": 100,
"page_token": "57kljdlzvvvsdfgg"
}'
Search for only location
folders
location
folderscurl -X POST "https://api.safetyculture.io/directory/v1/folders/search" \
-H "Authorization: Bearer {api_token}" \
-d '{
"query": "221 Sturt St",
"only_leaf_nodes": true
}'
Search folders in desc order
curl -X POST "https://api.safetyculture.io/directory/v1/folders/search" \
-H "Authorization: Bearer {api_token}" \
-d '{
"query": "221 Sturt St",
"order_by": { sort_order: 2 }
}'
Search for specific folders
curl -X POST "https://api.safetyculture.io/directory/v1/folders/search" \
-H "Authorization: Bearer {api_token}" \
-d '{
"query": "221 Sturt St",
"filters": [
{ "not": false, "folder_id": "4fb56fa8-fa23-4a9c-907e-8367abc75a2d" },
{ "not": false, "folder_id": "3fb56fa8-fa23-4a9c-907e-8367abc75a2f" },
{ "not": false, "folder_id": "2fb56fa8-fa23-4a9c-907e-8367abc75a2c" }
]
}'
Search for specific meta_labels and folders
curl -X POST "https://api.safetyculture.io/directory/v1/folders/search" \
-H "Authorization: Bearer {api_token}" \
-d '{
"query": "221 Sturt St",
"filters": [
{ "not": false, "meta_label": "location" },
{ "not": false, "folder_id": "3fb56fa8-fa23-4a9c-907e-8367abc75a2f" },
{ "not": false, "folder_id": "2fb56fa8-fa23-4a9c-907e-8367abc75a2c" }
]
}'