Bit Form API

An API (Application Protocol Interface) defines a set of functions that interact with other software components or applications or you can call micro services between web applications. If any web application or software needs any information from another software, they have to make a ‘call’ or ‘request’ to get the information. This specific call or request is called API.

To simplify this context, we can take an example that a user installed a form plugin from which he/she wants to deliver form data to our Bit Form plugin where user has already made a form. What user has to do is to make an API request to Bit Form. In response, user will get all the data that they have requested will be stored in Bit Form.

API key:

Api key is a unique identifier that defines every connecting request has a password consisting of some set of rules. The API key is a long string that you usually include in the request header. The API key mainly functions as a way to identify the person making the API call (authenticating you to use the API). The API key might also be associated with a specific app that you register API. Request header key name  Bitform-Api-Key“.

API key Option:

1.Go to Bit form ‘Settings‘ and then select ‘API

2.Copy your API key then use it in request header

API Status Codes :

The success or failure of an API request is conveyed by the code and message in its response.

HTTP status code

HTTP status

code

Message

200

Ok

4000

Successfully data added, updated, deleted, found

200

Ok

3910

No forms available

200

Ok

3920

No field available

400

Not Found

3030

The API request’s body content is missing

404

Not Found

3100

No Entry with ID

404

Not Found

3200

No Form with ID

404

Not Found

3130

No form was found. Please check and try again

422

validation error

3070

Data validation failure

1.Get Form: For transferring information at first user have to specify the form of Bit Form. To make this API request user has to call the ‘GET Form” function where ‘base_url’ is the user’s plugin URL link. THE requested URL is:

 https://<base_url>/wp-json/bitform/v1/forms

Requested Method is:

GET

image 1

2.Get Field: Next, user have to call the “GET Fields” function to fetch all the requested information of form that will be presented in Bit Form. Requested URL is :

 https://<base_url>/wp-json/bitform/v1/fields/<form_id>

API Status Codes- Get Field

Requested Method is:

GET

In this API request user have to indicate the specific id to ‘form_id‘ in which fields will be used to fetch information. Suppose a client sent an API request, under a specific form some field’s information will be inserted where , “typ” = field type, “lbl” = field label name, “ph“= a indicator of the fields action. The “valid” : {} denotes True/False. If the required field is enabled then “valid” : {} will return True otherwise “valid” : {} will be empty. Then ‘fieldkeys‘ is the key name  of the input field. Clients can also run workflows using conditional logic by sending API requests. As example, if a client wants any records to be created & submitted, an email notification will be sent. Clients have to set this workflow & have to mention that specific workflow name on their API request. They can set actions like : ‘Success Message’, ‘Redirect URL’, ‘Web hook’, ‘Integration’ and run those actions through our API request. The “workflow_key_name” is the input key name of all the created workflows.

3. Add record : This API add all the data to a form in your Bit Form plugin. Requested URL is:

https://<base_url>/wp-json/bitform/v1/entry/<form_id>

 

Requested Method is:

POST

form_id‘ is the targeted ID where your requested entry will be stored. If the form ID is not selected then this API request will be unsuccessful.

image

4.Edit Record-Detail View: This API edits the recorders regarding their ID value. THE requested URL is :

https://<base_url>/wp-json/bitform/v1/entry/<entry_id>

To edit the information user has to define the targeted entry id in ‘entry_id’

Requested Method is:

GET

view1

meta_key‘ is field key name, ‘meta_value‘ is the field value , ‘bitforms_form_entry_id’ is entry_id

 

5.Get All Entries : The entries response API  Requested URL is :

https://<base_url>/wp-json/bitform/v1/form/response/<id>

Requested Method is:

GET

To get all entries responses user have to define the targeted form id in ‘id’

entry response

 6.Update Record: The update API updates the recorders regarding their ID value. Requested URL is :

https://<base_url>/wp-json/bitform/v1/entry_update/<entry_id>

Requested Method is:

POST

Users have to set the entry name in ‘entry-id‘ .

 

image 4

7.Delete Record: To delete any records the requested API URL is :

https://<base_url>/wp-json/bitform/v1/entry/<entry_id>

Requested Method is:

DELETE

If a user wants to delete any of the records have to select entry id in ‘entry_id

image 3