Warning |
---|
Introduced in v5, the API Domain Whitelist setting in General Settings needs to be configured to allow JSON API requests. If a request is from a non-whitelisted domain, the response will be a HTTP 400 Bad Request. |
...
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
Form Data API and List Data API are newly added feature in Joget Workflow v6. |
Table of Contents indent 30px style circle
App
web/json/app/(*:appId)/(~:version)/form/(*:formId)/columns
...
Code Block | ||
---|---|---|
| ||
{ "appId" : "mcrm", "appName" : "Simple CRM", "appVersion: : "1" } |
web/json/apps/published/processes
...
Code Block | ||
---|---|---|
| ||
{ "data": [{ "packageId": "crm", "packageName": "CRM" }, { "packageId": "helpdesk", "packageName": "Helpdesk" }] } |
Assignments Assignments
web/json/workflow/assignment/accept/(*:activityId)
...
Code Block | ||
---|---|---|
| ||
{ "activityId": "843_208_crm_process1_send_proposal", "processVersion": "3", "activityDefId": "send_proposal", "processId": "208_crm_process1", "assigneeId": "admin", "description": "", "processName": "Proposal Approval Process", "dateCreated": "04-09-2015 03:05 AM", "participant": "Requester", "processDefId": "crm#3#process1", "variable": { "status": "approved" }, "activityName": "Send Proposal" } |
Processes
web/json/workflow/process/abort/(*:processId)
...
Code Block |
---|
{ "data": [{ "id": "hr_expense", "count": 2, "processVersion": "3", "packageName": "HR Expenses Claim App", "processId": "hr_expense#3#process1", "processName": "Expense Approval Process", "packageId": "hr_expense", "label": "HR Expenses Claim App", "url": "/json/workflow/process/list?packageId=hr_expense" }, { "id": "isr", "count": 1, "processVersion": "2", "packageName": "ISR", "processId": "isr#2#isr", "processName": "ISR Process", "packageId": "isr", "label": "ISR", "url": "/json/workflow/process/list?packageId=isr" }, { "id": "hrleave", "count": 2, "processVersion": "1", "packageName": "JINC Leave Solution", "processId": "hrleave#1#la", "processName": "Leave Application System", "packageId": "hrleave", "label": "JINC Leave Solution", "url": "/json/workflow/process/list?packageId=hrleave" }] } |
web/json/workflow/process/start/(*:processDefId)
Description
Starts a process based on process start whitelist
User Role
Anyone (Including anonymous)
Method
HTTP POST
Parameters
- callback - (Optional) a function (in JavaScript) to call back after invoking this method
processDefId - Process Definition Id (Replace '#' with ':' in the id)
Info title Obtaining Latest Published Process Version Instead of specifying crm:3:process1 in the call, we can use the keyword latest in the processDefId - crm:latest:process1 to automatically set to the published app's process version.
- processInstanceId - (Optional) used to start the previous created but haven't start process instance
- recordId - (Optional) used to start a process instance with existing record
- var_* - (Optional) parameters prefixed with "var_" will be used to set workflow variable
Sample URL
http://localhost:8080/jw/web/json/workflow/process/start/crm:3:process1
Sample Result
Code Block | ||
---|---|---|
| ||
{"activityId":"885_224_crm_process1_approve_proposal","processId":"224_crm_process1"} |
Note |
---|
For "activityId" to be returned, please ensure the "Show The Next Assignment When Completed" is checked under the Run Process activity in Map Activities to Forms tab and the next activity after the start of process is assigned to the same person that starts the process. |
web/json/workflow/process/variable/(*:processId)/(*:variable)
Description
Sets workflow variable of a process instance
User Role
Admin
Method
HTTP POST
Parameters
- callback - (Optional) a function (in JavaScript) to call back after invoking this method
- processId - process instnace id
- variable - workflow variable name
- value - value of workflow variable to be set
Sample URL
http://localhost:8080/jw/web/json/workflow/process/variable/208_crm_process1/status?value=test
Sample Result
Code Block | ||
---|---|---|
| ||
{"status" : "variableSet"} |
web/json/workflow/process/view/(*:processId)
Description
Retrieves information of a process definition
User Role
Admin
Method
HTTP GET/POST
Parameters
- callback - (Optional) a function (in JavaScript) to call back after invoking this method
- processId - Process Definition Id (Replace '#' with ':' in the id)
Sample URL
http://localhost:8080/jw/web/json/workflow/process/view/crm:3:process1
Sample Result
Code Block | ||
---|---|---|
| ||
{ "packageName": "CRM", "processId": "crm#3#process1", "name": "Proposal Approval Process", "packageId": "crm", "version": "3" } |
web/json/workflow/variable/list/(*:processId)
Description
Retrieves all variables of a process instance
User Role
Admin
Method
HTTP GET/POST
Parameters
- callback - (Optional) a function (in JavaScript) to call back after invoking this method
- processId - process instance id
Sample URL
http://localhost:8080/jw/web/json/workflow/variable/list/208_crm_process1
Sample Result
Code Block | ||
---|---|---|
| ||
{ "processId": "208_crm_process1", "variable": { "status": "approved" } } |
Monitoring
web/json/monitoring/activity/abort/(*:processId)/(*:activityDefId)
...
http://localhost:8080/jw/web/json/monitoring/user/reevaluate?username=cat
SLA
web/json/workflow/activity/sla/list
...
Code Block | ||
---|---|---|
| ||
{ "total": 3, "data": [{ "ratioOnTime": 100, "activityDefId": "approval", "serviceLevelMonitor": "<span class=\"dot_green\"> <\/span>", "minDelay": 0, "ratioWithDelay": 0, "maxDelay": 0, "activityName": "Approval" }, { "ratioOnTime": 100, "activityDefId": "parallel", "serviceLevelMonitor": "<span class=\"dot_green\"> <\/span>", "minDelay": 0, "ratioWithDelay": 0, "maxDelay": 0, "activityName": "Parallel" }, { "ratioOnTime": 100, "activityDefId": "route1", "serviceLevelMonitor": "<span class=\"dot_green\"> <\/span>", "minDelay": 0, "ratioWithDelay": 0, "maxDelay": 0, "activityName": "Route 1" }] } |
Audit Trail
web/json/workflow/audittrail/list
...
Code Block | ||
---|---|---|
| ||
{ "total": 3225, "data": [{ "timestamp": "25-06-2015 07:41 AM", "message": "Authentication for user admin: true", "id": "2c90a1574e29523a014e29aa77590000", "username": "anonymousUser", "method": "authenticate", "clazz": "org.joget.apps.workflow.security.WorkflowAuthenticationProvider" }, { "timestamp": "25-06-2015 08:41 AM", "message": "Authentication for user admin: true", "id": "2c90a1574e29e104014e29e178080000", "username": "anonymousUser", "method": "authenticate", "clazz": "org.joget.apps.workflow.security.WorkflowAuthenticationProvider" }, { "timestamp": "25-06-2015 08:55 AM", "message": "testProcess", "id": "2c90a1574e29e81c014e29eddb7a0000", "username": "admin", "method": "processUpload", "clazz": "org.joget.workflow.model.service.WorkflowManagerImpl" }, { "timestamp": "25-06-2015 08:55 AM", "message": "50_testProcess_process1", "id": "2c90a1574e29e81c014e29eddecf0001", "username": "anonymousUser", "method": "processCompleted", "clazz": "org.joget.workflow.model.service.WorkflowManagerImpl" }, { "timestamp": "25-06-2015 08:55 AM", "message": "50_testProcess_process1", "id": "2c90a1574e29e81c014e29edded80002", "username": "anonymousUser", "method": "processCompleted", "clazz": "org.joget.workflow.model.service.WorkflowManagerImpl" }] } |
Directory
web/json/directory/admin/dept/list
...
- callback - (Optional) a function (in JavaScript) to call back after invoking this method
- j_username - (Optional) username for login
- j_password - (Optional) password for login
- hash - (Optional) Hashed Password
...
http://localhost:8080/jw/web/json/directory/user/sso?j_username=admin&j_password=admin
Sample Result
Code Block | ||
---|---|---|
| ||
{"username":"admin","isAdmin":"true"}", "token": "OWASP_CSRFTOKEN=7BKT-GL1V-Y5LR-T3JJ-41W2-JRBL-CCDB-7C03"} |
web/json/workflowweb/json/workflow/currentUsername
Description
Retrieves the username of current logged in user
...
Code Block | ||
---|---|---|
| ||
{"username":"admin"} |
Plugin
web/json/plugin/list
Description
Retrieves a list of plugins
...
Code Block | ||
---|---|---|
| ||
[{ title: 'Configure Bean Shell', properties: [{ name: 'script', label: 'Script', type: 'codeeditor', required: 'True', mode: 'java' }] }] |
System
web/json/apps/verify
Description
Verifies a URL is valid
...
Code Block | ||
---|---|---|
| ||
{"success":true,"datasource":"default"} |
Form Data API
web/json/data/form/load/(*:appId)/(*:formId)/(*:primaryKeyValue)
Description
Load a specific form record
User Role
Admin
Method
HTTP GET/POST
Parameters
- appId - App definition ID
- formId - Form definition ID
- primaryKeyValue - The primary key value for the form record
includeSubformData - Optional, set to true to recursively include subform data
includeReferenceElements - Optional, set to true to include data from reference elements e.g. selectbox, etc.
flatten - Optional, set to true to flatten data into a one level key-value map
Sample URL
http://localhost:8080/jw/web/json/data/form/load/crm/crm_account/001
Sample cURL Request
Code Block | ||
---|---|---|
| ||
curl -v -d "j_username=admin&j_password=admin" "http://localhost:8080/jw/web/json/data/form/load/crm/crm_account/001?includeSubformData=true&includeReferenceElements=true&flatten=true" |
Sample Response
Code Block | ||
---|---|---|
| ||
{
"country": "",
"dateCreated": "27-07-2015 04:26 AM",
"address": "",
"accountName": "001",
"city": "",
"dateModified": "20-10-2016 04:36 AM",
"id": "001",
"state": ""
} |
web/json/data/form/store/(*:appId)/(*:formId)/(*:primaryKeyValue)
Description
Create or update a form record
User Role
Admin
Method
HTTP POST
Parameters
- appId - App definition ID
- formId - Form definition ID
- primaryKeyValue - The primary key value for the form record
Sample URL
http://localhost:8080/jw/web/json/data/form/store/crm/crm_account/001
Sample cURL Request
Code Block | ||
---|---|---|
| ||
curl -v -X POST -d "j_username=admin&j_password=admin&accountName=001%Updated&address=001%20Address" http://localhost:8080/jw/web/json/data/form/store/crm//crm_account/001 |
or
Code Block | ||
---|---|---|
| ||
curl -v --header "Authorization: Basic YWRtaW46YWRtaW4=" -F "accountName=001 Updated" -F "address=001 Address" http://localhost:8080/jw/web/json/data/form/store/crm//crm_account/001 |
Sample Response
Code Block | ||
---|---|---|
| ||
{
"id": "001"
} |
web/json/data/form/delete/(*:appId)/(*:formId)/(*:primaryKeyValue)
Description
Delete an existing form record
User Role
Admin
Method
HTTP POST
Parameters
- appId - App definition ID
- formId - Form definition ID
- primaryKeyValue - The primary key value for the form record
Sample URL
http://localhost:8080/jw/web/json/data/form/delete/crm/crm_account/001
Sample cURL Request
Code Block | ||
---|---|---|
| ||
curl -v -X POST -d "j_username=admin&j_password=admin" http://localhost:8080/jw/web/json/data/form/delete/crm//crm_account/001 |
Sample Response
Code Block | ||
---|---|---|
| ||
{
"id": "001"
} |
List Data API
web/json/data/list/(*:appId)/(*:listId)
Description
Load records from a specific datalist
User Role
Admin
Method
HTTP GET/POST
Parameters
- appId - App definition ID
- listId - Datalist definition ID
- start - Optional start index (begins at 0)
- rows - Optional number of rows to return
- URL Request Parameter - Optional filters (e.g. d-5043735-fn_accountName)
Sample URL
http://localhost:8080/jw/web/json/data/list/crm/crm_account_list
Sample cURL Request
Code Block | ||
---|---|---|
| ||
curl -v -d "j_username=admin&j_password=admin" http://localhost:8080/jw/web/json/data/list/crm/crm_account_list?start=0&rows=20&d-5043735-fn_accountName=00 |
Sample Response
Info | ||
---|---|---|
| ||
The returned attribute "total" will give the the total number of records regardless of the filters applied unless the attribute "Consider filter value when get total size?" is checked in the datalist. |
Code Block | ||
---|---|---|
| ||
{
"total": 5,
"data": [{
"country": "",
"accountName": "001 Updated",
"id": "001",
"state": ""
}, {
"country": "",
"accountName": "002",
"id": "002",
"state": ""
}, {
"country": "",
"accountName": "003",
"id": "003",
"state": ""
}]
} |