Skip to main content
Skip table of contents

Create Form

This API allows you to create form. 

The endpoints, properties and code examples are given as follows:

POST/forms

The body should be in JSON format and include the following properties:

Request

ParameterDescriptionTypeProperties

id REQUIRED 

System generated form ID

String

-

formTitle REQUIRED

Name of the formString-

formDescription OPTIONAL

Description of the formString-

attributes REQUIRED

Attributes are fields (key-value) pairs required in the form. More than one field can be added separated the comma.Object
  1.  key - String - auto-generated to attach a unique ID to an attribute (usually the name of the attribute is considered its key) e.g. "first_name"
  2.  label - String - name of the field e.g. "First Name"
  3.  helpText - String - alt text for the field e.g. "This is helping text"
  4.  attributeType - List - type of the field. There are two options:
    1. Input - Input fields such as text
    2. Options - allows custom categories to be created by user. Each category has to be unique and cannot be repeated.
  5.  valueType - String - value type of the field (Validation API will be called to validate the custom type)  e.g. "String100"
  6.  isRequired - Boolean - check if it mandatory to be filled
  7.  categoryOptions - Object - will be enabled if attributeType = Options. This is a sub-category in Options.

Response

CodeDescription

200

Code 200 implies that the message has been accepted.

CODE
{
    "id":"1",
    "formTitle": "New Form",
    "formDescription": "This is helping text.",
    "attributes": [
        {
            "key": "first_name",
            "label": "First Name",
            "helpText": "This is helping text",
            "attributeType": "INPUT",
            "valueType": "String100",
            "isRequired": true,
            "categoryOptions": {}
        },
        {
            "key": "state_name",
            "label": "State Name",
            "helpText": "This is helping text",
            "attributeType": "OPTIONS",
            "valueType": "StringList",
            "isRequired": true,
            "categoryOptions": 
            {
                "isMultipleChoice": true,
                "categories": [
                    {
                        "categoryName": "Category1",
                        "values": [
                            "Badin",
                            "Chaman",
                            "Balakot"
                        ]
                    }
                ]
            }
        }
    ]
}

Quick Links

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.