Forms
Respond to a form
Saves one submission of a form and marks it completed. Who can call it:
- A signed-in member of the form’s company can answer any of the company’s forms, including drafts. The answers are filed under their membership, and
contactis ignored. - Anyone else can answer only an
activeform, and must sendcontactwith anemail. The answers are filed under a new contact of the form’s company. Unauthenticated calls are deprecated and return aDeprecation: trueheader: collect public answers through the form’s public token instead.
Every form_element_id must belong to this form. This endpoint doesn’t check required elements or the form’s type and countries. A submission sends the form_submitted webhook event. Returns 404 when the form doesn’t exist or the caller can’t answer it.
POST
/
api
/
forms
/
{id}
/
respond
Respond to a form
curl --request POST \
--url https://api.fluid.app/api/forms/{id}/respond \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"form_response": {
"contact": {
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>"
},
"responses": [
{
"form_element_id": 123,
"answer": "<string>"
}
]
}
}
'import requests
url = "https://api.fluid.app/api/forms/{id}/respond"
payload = { "form_response": {
"contact": {
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>"
},
"responses": [
{
"form_element_id": 123,
"answer": "<string>"
}
]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
form_response: {
contact: {first_name: '<string>', last_name: '<string>', email: '<string>'},
responses: [{form_element_id: 123, answer: '<string>'}]
}
})
};
fetch('https://api.fluid.app/api/forms/{id}/respond', 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/{id}/respond",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'form_response' => [
'contact' => [
'first_name' => '<string>',
'last_name' => '<string>',
'email' => '<string>'
],
'responses' => [
[
'form_element_id' => 123,
'answer' => '<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fluid.app/api/forms/{id}/respond"
payload := strings.NewReader("{\n \"form_response\": {\n \"contact\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"responses\": [\n {\n \"form_element_id\": 123,\n \"answer\": \"<string>\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fluid.app/api/forms/{id}/respond")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"form_response\": {\n \"contact\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"responses\": [\n {\n \"form_element_id\": 123,\n \"answer\": \"<string>\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/forms/{id}/respond")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"form_response\": {\n \"contact\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"responses\": [\n {\n \"form_element_id\": 123,\n \"answer\": \"<string>\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"responses": [
{
"id": 123,
"form_element_id": 123,
"form_respondent_id": 123,
"response": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}{
"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"
}
}{
"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 to answer.
Body
application/json
The submission. Required.
Show child attributes
Show child attributes
⌘I
Respond to a form
curl --request POST \
--url https://api.fluid.app/api/forms/{id}/respond \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"form_response": {
"contact": {
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>"
},
"responses": [
{
"form_element_id": 123,
"answer": "<string>"
}
]
}
}
'import requests
url = "https://api.fluid.app/api/forms/{id}/respond"
payload = { "form_response": {
"contact": {
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>"
},
"responses": [
{
"form_element_id": 123,
"answer": "<string>"
}
]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
form_response: {
contact: {first_name: '<string>', last_name: '<string>', email: '<string>'},
responses: [{form_element_id: 123, answer: '<string>'}]
}
})
};
fetch('https://api.fluid.app/api/forms/{id}/respond', 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/{id}/respond",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'form_response' => [
'contact' => [
'first_name' => '<string>',
'last_name' => '<string>',
'email' => '<string>'
],
'responses' => [
[
'form_element_id' => 123,
'answer' => '<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fluid.app/api/forms/{id}/respond"
payload := strings.NewReader("{\n \"form_response\": {\n \"contact\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"responses\": [\n {\n \"form_element_id\": 123,\n \"answer\": \"<string>\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fluid.app/api/forms/{id}/respond")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"form_response\": {\n \"contact\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"responses\": [\n {\n \"form_element_id\": 123,\n \"answer\": \"<string>\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/forms/{id}/respond")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"form_response\": {\n \"contact\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"responses\": [\n {\n \"form_element_id\": 123,\n \"answer\": \"<string>\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"responses": [
{
"id": 123,
"form_element_id": 123,
"form_respondent_id": 123,
"response": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}{
"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"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}