Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
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
borderColorpurple
borderWidth1
titleBGColor#ddccff
borderStylesolid
titleNew Feature

Form Data API and List Data API are newly added feature in Joget Workflow v6.

Table of Contents
indent30px
stylecircle

...

Code Block
languagejs
{"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
languagejs
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
languagejs
{
    "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
languagejs
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
languagejs
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
languagejs
{
    "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
languagejs
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
languagejs
{
    "id": "001"
}

List Data API

web/json/data/list/(*:appId)/(*:listId)

Description
Load a specific form record

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

Sample URL
http://localhost:8080/jw/web/json/data/list/crm/crm_account_list

Sample cURL Request

Code Block
languagejs
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

Sample Response

Code Block
languagejs
{
    "total": 3,
    "data": [{
        "country": "",
        "accountName": "001 Updated",
        "id": "001",
        "state": ""
    }, {
        "country": "",
        "accountName": "002",
        "id": "002",
        "state": ""
    }, {
        "country": "",
        "accountName": "003",
        "id": "003",
        "state": ""
    }]
}