This guide uses the Add form data API as an example.
This will add a record to the "Sample Form" form table, and is observable via the "Manage Sample Form" CRUD menu.
To call this API, we must know these values:
- API URL: http://localhost:8080/jw/api/form/sampleForm (Change the domain/port as needed according to your Joget server)
- HTTP Method (In this case, it is a POST call)
- Mandatory parameter(s) to fill up.
This API only requires 1 mandatory path parameter --> formId (Path parameter is to be keyed into the API URL itself) - Body Parameter(s) to fill up.
Here expects JSON key-pair value(s). This is highly dependent on the fields that exists in the specified form, and which are mandatory to fill up.
If no record ID is specified, a uniquely generated UUID will be created.
In the case of the sample form in this sample app, there are no mandatory fields. This is the body value we will use in this example:
{ "name": "apples", "quantity": "30", "price": "6.89" }
- API Document ID: API-0f6e9f1f-6e1d-4e9e-9bd2-fb34c67b2696 (You can find this value by editing the API document > Properties)
- API Key (unique API Key that you've created in your API access)
Reference: https://dev.joget.org/community/display/marketplace/Form#Form-Addformdata
Now to construct the API call, these are the required request header fields:
- api_id
- api_key
Now with the information above, this is how it looks like in Postman.
The expected reponse returned:
{
"id": "bb134e0f-7782-4e99-80d1-fce0a960753b",
"errors": {}
}
End result observed in "Manage Sample Data" CRUD: