curl --request GET \
--url https://formhug.ai/api/v1/f/{form_token} \
--header 'Authorization: Bearer <token>'import requests
url = "https://formhug.ai/api/v1/f/{form_token}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://formhug.ai/api/v1/f/{form_token}', 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://formhug.ai/api/v1/f/{form_token}",
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://formhug.ai/api/v1/f/{form_token}"
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://formhug.ai/api/v1/f/{form_token}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://formhug.ai/api/v1/f/{form_token}")
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": {
"name": "Customer feedback",
"description": "Please share your feedback",
"token": "Wabc12",
"scene": "survey",
"layout": "classic",
"locale": "en",
"timezone": "UTC",
"fields": [
{
"type": "short_text",
"label": "Name",
"api_code": "field_1",
"notes": "Please use your real name",
"private": false,
"required": true,
"customized_validation_message": "<string>",
"cid": "<string>",
"predefined_value": "<string>",
"placeholder": "<string>",
"answers": [
{
"score": 123,
"answer": [
"<string>"
]
}
],
"answer_explanation": "<string>"
}
],
"field_rules": [
{
"operator": "or",
"targets_display_mode": "show",
"rule_sets": [
{
"trigger": "<string>",
"comparator": "equal",
"condition": "<string>"
}
],
"targets": [
"<string>"
]
}
]
}
}{
"error": "Authentication failed"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "Form not found"
}Get a published form's public structure
Returns a published form’s public structure — its public fields and conditional
field-display rules — for filling the form or interpreting field_values. Private
fields and owner-only settings are never included.
If the form is password-protected, pass the password in the X-Form-Access-Password header.
Required scope: form:respond.
curl --request GET \
--url https://formhug.ai/api/v1/f/{form_token} \
--header 'Authorization: Bearer <token>'import requests
url = "https://formhug.ai/api/v1/f/{form_token}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://formhug.ai/api/v1/f/{form_token}', 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://formhug.ai/api/v1/f/{form_token}",
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://formhug.ai/api/v1/f/{form_token}"
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://formhug.ai/api/v1/f/{form_token}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://formhug.ai/api/v1/f/{form_token}")
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": {
"name": "Customer feedback",
"description": "Please share your feedback",
"token": "Wabc12",
"scene": "survey",
"layout": "classic",
"locale": "en",
"timezone": "UTC",
"fields": [
{
"type": "short_text",
"label": "Name",
"api_code": "field_1",
"notes": "Please use your real name",
"private": false,
"required": true,
"customized_validation_message": "<string>",
"cid": "<string>",
"predefined_value": "<string>",
"placeholder": "<string>",
"answers": [
{
"score": 123,
"answer": [
"<string>"
]
}
],
"answer_explanation": "<string>"
}
],
"field_rules": [
{
"operator": "or",
"targets_display_mode": "show",
"rule_sets": [
{
"trigger": "<string>",
"comparator": "equal",
"condition": "<string>"
}
],
"targets": [
"<string>"
]
}
]
}
}{
"error": "Authentication failed"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "Form not found"
}Authorizations
Personal Access Token prefixed with fh_. Sent as Authorization: Bearer fh_xxx.
The scope required by each endpoint is listed in that endpoint's description.
Headers
Access password, when the form is password-protected
Path Parameters
Token of a published form
Response
Password supplied via header unlocks a protected form
A published form's public structure: public fields and conditional field-display rules. Private fields and owner-only settings are excluded.
Show child attributes
Show child attributes
Was this page helpful?