Data Store REST API
The Data Store REST Service is used for remote DataStore management through WorkFusion application.
Generally, the REST service works with JSON data.
Configuration
important
To work with Data Stores, use the /soap/v1/datastores URL.
URL Examples
https://custom-name.workfusion.com/workfusion/soap/v1/datastores
API Security
All API postings are made over a Secure Sockets Layer (SSL) connection, which encrypts communications between the user and web server to ensure data remains private.
note
All requests must be preceding with https://.
WorkFusion REST API supports basic (login and password hash) authentication to ensure that APIs are only accessible to those with the proper credentials.
Basic authentication
- username: Your username in Control Tower.
- password: Hash of your password in Control Tower.
Using REST API with SSO
When using REST API with SSO you can not use your SSO ID or password. The recommended approach for using REST API with SSO enabled is the following:
- Disable SSO:
wf.sso.saml.enable=false - Restart Control Tower:
wfmanager restart workfusion - Log in to Workfusion with pre-SSO ID and password.
- Create a special REST API user and grant necessary permissions. Assign a proper role.
- Enable SSO:
wf.sso.saml.enable=true - Restart Control Tower:
wfmanager restart workfusion - To log in, use the
/workfusion/api/dologinenpoint./workfusion/dologinis disabled once you turn on SSO.
Now, SSO is enabled, but you can use that REST API user id/password for REST API authentication.

Operations
Rules applied to the Data Store queries:
Add the
ds_prefix to the Data Store name.If you have some UPPERCASE characters in the Data Store name, wrap the whole name in double quotes like this:
"ds_01_WL_CL_HT_DD"Use the PostgreSQL syntax.
Request
| Name | Resource Path | HttpMethod | Parameters | Example URL |
|---|---|---|---|---|
| Execute | /execute | POST |
|
/soap/v1/datastores/select?query=DELETE FROM ds_testDataStore |
| Select | /select | GET |
|
/soap/v1/datastores/select?query=SELECT * FROM "ds_testDataStore"&maxRows=5 |
| CreateOrUpdate | /{name}/createOrUpdate | POST |
|
/soap/v1/datastores/testDataStore/createOrUpdate
Body (Content-Type: application/json)
|
| Insert | /{name}/insert | POST |
|
/soap/v1/datastores/testDataStore/insert |
Examples:
CreateOrUpdate:
/soap/v1/datastores/datastore_name/createOrUpdateBody:
{ "columns": { "name": "TEXT", "surname": "TEXT" } }Insert:
/soap/v1/datastores/datastore_name/insertBody:
{ "headers": [ "name", "surname" ], "values": [ "value1", "value2" ] }
Response
Consists of three parts:
responseStatus: "SUCCESS", "FAILURE"body: response data DTOerrors: collection of business errors if a request fails
Examples:
/soap/v1/datastores/select?query=SELECT * FROM "ds_testDataStore"&maxRows=5
Success:
{
"responseStatus": "SUCCESS",
"body": {
"rowData": [
{
"columnDescriptions": [
{
"type": 4,
"name": "ds_testDataStore_id"
},
{
"type": 12,
"name": "column1"
},
{
"type": 4,
"name": "column2"
}
],
"rowData": [
1,
"value1",
5
]
}
]
},
"errors": []
}
Failure:
{
"responseStatus": "FAILURE",
"body": null,
"errors": [
{
"code": 0,
"message": "StatementCallback; bad SQL grammar [SELECT * from \"ds_testDataStores\"]; nested exception is org.postgresql.util.PSQLException: error: relation \"ds_testDataStores\" doesn't exist\n Position: 15"
}
]
}
Access Data Store service in Manual Tasks
There is a possibility to insert Data Store REST API calls in Manual Tasks using AJAX.
In that case, the service URL is:
/workfusion/public/datastores
The security is provided by:
- Unique task
hitIdparameter - Allowed Data Store queries set in Manual Task designer
- Task status that works only for active tasks