List form elements
Lists the elements of one of your company’s forms, lowest position first. The list includes elements that later edits deactivated, which keep their answers; the response doesn’t mark which elements are active, so use form_components on the form for the current layout. Needs a company admin token. This list is paginated by page number. Send page (default 1) and per_page (default 20); pagination in the response reports the current page, total pages, and total count.
Element types a form can contain, as stored in each component’s element_type:
short_text_entry: a single line of text.long_text_entry: a paragraph of text.number_entry: a number. The builder’s minimum and maximum digit settings (min,max) are saved with the element but are not enforced when the form is answered at checkout.multiple_choice_entry: one choice frommultiple_choice_options.yes_no_entry: a yes or no answer fromyes_no_options.checkbox: a single checkbox.file_upload: a file the respondent uploads. The answer is the file’s URL.input: a prebuilt identity field. Itspuck_typenames which one:email,legal_name,full_name,phone_number,date_of_birth, orssn.header,information,section_label,helper_text,error_text,page_break, andbutton: layout and text. They collect nothing.file_download: a file the respondent can download. It collects nothing.
Checkout also renders the older text, date, number, email, legal_name, ssn, and date_of_birth types. It skips any type it doesn’t recognize.
curl --request GET \
--url https://api.fluid.app/api/forms/{form_id}/form_elements \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.fluid.app/api/forms/{form_id}/form_elements"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.fluid.app/api/forms/{form_id}/form_elements', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fluid.app/api/forms/{form_id}/form_elements",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.fluid.app/api/forms/{form_id}/form_elements"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.fluid.app/api/forms/{form_id}/form_elements")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/forms/{form_id}/form_elements")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": 123,
"metadata": {
"label": "<string>",
"placeholder": "<string>",
"required": true
},
"position": 123,
"title": "<string>",
"type": "<string>"
}
],
"filters": {
"sorted_by": [
[
"<string>"
]
]
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"pagination": {
"current_page": 123,
"per_page": 123,
"total_count": 123,
"total_pages": 123
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}Authorizations
Bearer token authentication
Path Parameters
ID of the form.
Query Parameters
Page number, starting at 1. Defaults to 1.
Number of elements per page. Defaults to 20.
Not applied by the server. Elements are always sorted by position, lowest first.
Response
Success
The form elements on this page, lowest position first.
Show child attributes
Show child attributes
The sort options for form elements.
Show child attributes
Show child attributes
Request metadata.
Show child attributes
Show child attributes
Where this page sits in the full list.
Show child attributes
Show child attributes
curl --request GET \
--url https://api.fluid.app/api/forms/{form_id}/form_elements \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.fluid.app/api/forms/{form_id}/form_elements"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.fluid.app/api/forms/{form_id}/form_elements', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fluid.app/api/forms/{form_id}/form_elements",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.fluid.app/api/forms/{form_id}/form_elements"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.fluid.app/api/forms/{form_id}/form_elements")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/forms/{form_id}/form_elements")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": 123,
"metadata": {
"label": "<string>",
"placeholder": "<string>",
"required": true
},
"position": 123,
"title": "<string>",
"type": "<string>"
}
],
"filters": {
"sorted_by": [
[
"<string>"
]
]
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"pagination": {
"current_page": 123,
"per_page": 123,
"total_count": 123,
"total_pages": 123
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}