Overview
The CWM form API allows you to create, update and delete forms. While creating a form in CWM 2.1 is possible via the CWM UI, defining advanced forms with more functionalities using a JSON file is available only via API.
The following API endpoints are available for handling forms:
GET/form: gets a list of forms existing in the CWM application.POST/form: creates a new form in the CWM application.GET/form/{formId}: gets the details of a specific form existing in the CWM application.DELETE/form/{formId}: deletes a form from the CWM application.PATCH/form/{formId}: updates an existing form with new settings.
Create a Form
To create a form, follow the steps below:
- Open Postman and in the CWM API collection, expand the form section and click the
POST | Create a new form.endpoint. - Inside the endpoint, click Body and in the raw field, provide the contents of the JSON file in which your form is defined inside the
formSchemakey. - Fill in the
name,formId, anddescriptionkeys with appropriate values. - Click Post.
If the server response code is 201, the form has been successfully created.
Update a Form
To edit a form, follow the steps below:
- Open Postman and in the CWM API collection, expand the form section and click the
PATCH | Update a specific form.endpoint. - Inside the endpoint, click Body and fill in the
name,formId, anddescriptionkeys with appropriate values. - In the
formSchemakey, provide the entire JSON file with values to be modified. - Click Post.
If the server response code is
200, the form has been successfully updated.
Updating a form replaces the entire configuration. It means that if you want to change only one existing value, you still need to pass all of the details again, even if they are the same.