Work with direct links via API
API
WorkSpace provides API to retrieve a list of active assignments with direct links.
GET /api/internal/assignments?attr1=value1&attr2=value2&attrN=valueN
GET parameters are not required and can be used to filter the list of assignments. Mind that API returns max 100 assignments.
The response contains JSON in the following format:
{
"items": [
{
"link": "https://HOST:443/workspace/assignments/aa8a165a-2290-4e3e-ac6e-677d7961ad7e",
"id": "aa8a165a-2290-4e3e-ac6e-677d7961ad7e",
"status": "READY_TO_PROCESS"
}
],
"pageInfo": {
"number": 1,
"size": 100,
"totalElements": 1
}
}
API usage examples
An example of how to get a full list of active assignments (limited by 100 items):
curl -X GET http://127.0.0.1:5082/workspace/api/internal/assignments
An example of how to get a list of active assignments that have attribute attr1 with value1 and attr2 with value2 (limited by 100 items):
curl -X GET http://127.0.0.1:5082/workspace/api/internal/assignments?attr1=value1&attr2=value2
How to use API in bot steps
The workspaceApiInternalHost parameter contains the WorkSpace host. Thus, when you create a bot step and want to use WorkSpace internal API, you should use the workspaceApiInternalHost parameter, for example:
<?xml version="1.0" encoding="UTF-8"?>
<config charset="UTF-8">
<script></script>
</config>
Use the following code to generate a full URL to retrieve a list of active assignments with direct links:
<?xml version="1.0" encoding="UTF-8"?>
<config charset="UTF-8">
<script></script>
</config>