Use filters to list specific files
- Zuletzt aktualisiert2020/05/12
Use filters to list specific files
This example shows how to send a POST request with filters to return all the bots from your repository that meet the search criteria. In this example, you
have bots in several folders that contain the word test
. Use the filters to
return only the bots with test
in the name.
Prerequisites
- JSON Web Token (JWT)
- All Control Room APIs require a JSON Web Token (JWT) to access the APIs. Generate an authentication token using the Enterprise 11 Authentication API.
- Permissions
- You must have permission for the folder in which you want to perform operations. If you can view files in the Control Room interface, then you can use this API.
Note:
- Use the Swagger definition files installed with your Control Room to test the APIs. View the available Swagger APIs at
http://<your_control_room_url>/swagger/
. - You can also use a REST client to complete this task.
Procedure
Note: You can also run REST requests from a command terminal. The following is a curl request
example. This example is formatted for readability. Replace the text inside the
angle brackets,
<authentication_token>
, with your authentication
token.curl -X POST "<your_control_room_url>/v1/repository/filefolder/list" -H "accept: application/json"
-H "X-Authorization: <authentication_token>" -H "Content-Type: application/json"
-d "{
\"sort\": [ {
\"field\": \"parentid\",
\"direction\": \"asc\"
} ],
\"filter\": {
\"operator\": \"substring\",
\"value\": \"test\",
\"field\": \"name\" },
\"fields\": [],
\"page\": { }
}"