Skip to main content
Version: 10.2.8

Use direct assignment links via API

API

WorkSpace provides API to retrieve a list of active assignments with direct links.

GET /api/internal/{tenant}/assignments?attr1=value1&attr2=value2&attrN=valueN

where tenant is the tenant's name. For a single-tenant environment, the parameter is still required. The default tenant is WorkfusionRealm. So usually, the GET call should look as follows:

GET /api/internal/WorkfusionRealm/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 a maximum of 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) in a single-tenant environment:

curl -X GET http://127.0.0.1:5082/workspace/api/internal/WorkfusionRealm/assignments

An example of how to get a complete list of active assignments that have the attr1 attribute with value1 and attr2 with value2 (limited by 100 items, single-tenant environment):

curl -X GET http://127.0.0.1:5082/workspace/api/internal/WorkfusionRealm/assignments?attr1=value1&attr2=value2

Using 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, use the workspaceApiInternalHost parameter, for example:

<?xml version="1.0" encoding="UTF-8"?>
<config charset="UTF-8">
<script>
<![CDATA[
String workspaceHost = workspaceApiInternalHost.toString();
log.info("Workspace host: {}", workspaceHost);
]]>
</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>
<![CDATA[
String workspaceHost = workspaceApiInternalHost.toString();
String fullURL = workspaceHost + "/workspace/api/internal/WorkfusionRealm/assignments";
log.info("Full URL: {}", fullURL);
]]>
</script>
</config>