Create a form
Needs: Forms, Read-write
Creates a draft form with steps, fields, conditional visibility, routing, settings, and incident, prospect or client pre-fill setup, checked with the form builder's rules. Responses are assigned to the organisation owner by default. The form is not published until you publish it.
Note: The response can also include
notesabout adjustments made, andissuesthat still need fixing before the form can be published. A field is{type, label, ...settings}, and you can set your ownkeyfor it so later conditions can refer to it.
curl -X POST "https://app.imploy.com.au/api/integrations/v1/forms" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"name": "Visit feedback",
"description": "Collect feedback after a visit.",
"tags": [
"Feedback"
],
"steps": [
{
"title": "Details",
"fields": [
{
"type": "text",
"label": "Client name",
"required": true
},
{
"type": "select",
"label": "Service",
"options": [
"Support",
"Transport"
]
}
]
}
]
}'
import requests
import json
url = "https://app.imploy.com.au/api/integrations/v1/forms"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"name": "Visit feedback",
"description": "Collect feedback after a visit.",
"tags": [
"Feedback"
],
"steps": [
{
"title": "Details",
"fields": [
{
"type": "text",
"label": "Client name",
"required": true
},
{
"type": "select",
"label": "Service",
"options": [
"Support",
"Transport"
]
}
]
}
]
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://app.imploy.com.au/api/integrations/v1/forms", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"name": "Visit feedback",
"description": "Collect feedback after a visit.",
"tags": [
"Feedback"
],
"steps": [
{
"title": "Details",
"fields": [
{
"type": "text",
"label": "Client name",
"required": true
},
{
"type": "select",
"label": "Service",
"options": [
"Support",
"Transport"
]
}
]
}
]
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"name": "Visit feedback",
"description": "Collect feedback after a visit.",
"tags": [
"Feedback"
],
"steps": [
{
"title": "Details",
"fields": [
{
"type": "text",
"label": "Client name",
"required": true
},
{
"type": "select",
"label": "Service",
"options": [
"Support",
"Transport"
]
}
]
}
]
}`)
req, err := http.NewRequest("POST", "https://app.imploy.com.au/api/integrations/v1/forms", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://app.imploy.com.au/api/integrations/v1/forms')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"name": "Visit feedback",
"description": "Collect feedback after a visit.",
"tags": [
"Feedback"
],
"steps": [
{
"title": "Details",
"fields": [
{
"type": "text",
"label": "Client name",
"required": true
},
{
"type": "select",
"label": "Service",
"options": [
"Support",
"Transport"
]
}
]
}
]
}'
response = http.request(request)
puts response.body
{
"created": 14,
"id": 14,
"name": "Visit feedback",
"description": "Collect feedback after a visit.",
"published": "off",
"url": null,
"settings": {
"allow_step_navigation": false,
"show_step_numbers": true,
"submit_button_text": "Submit"
}
}
{
"message": "Invalid or expired access token."
}
{
"message": "Access token does not permit this action."
}
{
"message": "Too many requests."
}
/forms
Target server for requests. Edit to use your own host.
An organisation access token that starts with imp_at_. Send it as Authorization: Bearer imp_at_XXXX.
imp_at_. Send it as Authorization: Bearer imp_at_XXXX.The media type of the request body
The form name, up to 255 characters.
What the form is for.
Steps in order. Each has a title, an optional key, a list of fields, and optional routing rules. Defaults to one empty step.
The same keys as update_settings in the edit endpoint.
The same as set_incident in the edit endpoint.
The same as set_prospect in the edit endpoint.
The same as set_client_prefill in the edit endpoint.
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token. An organisation access token that starts with imp_at_. Send it as Authorization: Bearer imp_at_XXXX.
Body
The form name, up to 255 characters.
What the form is for.
Steps in order. Each has a title, an optional key, a list of fields, and optional routing rules. Defaults to one empty step.
The same keys as update_settings in the edit endpoint.
The same as set_incident in the edit endpoint.
The same as set_prospect in the edit endpoint.
The same as set_client_prefill in the edit endpoint.