Forms
Open a published form and obtain a signed session
An open link is anonymous. An invitation-only form requires a valid invite. The returned session_id is bound to the published version and invitation. A general link never proves a respondent’s identity. Session lifetime is at most 14 days. Only allowed URL parameters are signed (maximum 1024 total bytes). Public JSON excludes editor notes and private AI config.
GET
/
api
/
v2
/
forms
/
{publicCode}
Open a published form and obtain a signed session
curl --request GET \
--url https://app.huechat.ai/api/v2/forms/{publicCode}import requests
url = "https://app.huechat.ai/api/v2/forms/{publicCode}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://app.huechat.ai/api/v2/forms/{publicCode}', 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://app.huechat.ai/api/v2/forms/{publicCode}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://app.huechat.ai/api/v2/forms/{publicCode}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.huechat.ai/api/v2/forms/{publicCode}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.huechat.ai/api/v2/forms/{publicCode}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"form": {
"title": "<string>",
"public_code": "<string>",
"version": 123,
"definition": {
"language": "en",
"questions": [
{
"id": "<string>",
"type": "welcome",
"title": "<string>",
"required": true,
"options": [
"<string>"
],
"rows": [
"<string>"
],
"columns": [
"<string>"
],
"min": 123,
"max": 123,
"score": {},
"description": "<string>",
"placeholder": "<string>",
"titleDelta": {
"ops": [
{
"insert": "<string>",
"attributes": {
"bold": true,
"italic": true,
"underline": true
}
}
]
},
"descriptionDelta": {
"ops": [
{
"insert": "<string>",
"attributes": {
"bold": true,
"italic": true,
"underline": true
}
}
]
},
"images": [
"<string>"
],
"mediaUrl": "<string>",
"mediaKind": "image",
"presentation": "text",
"randomize": true,
"currency": "<string>",
"amount": 5000000,
"redirectUrl": "<string>",
"schedule": {
"service_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resource_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"ai": {
"max_turns": 2
}
}
],
"branding": {
"name": "<string>",
"logo_url": "<string>",
"logo_alt": "<string>",
"show_logo": true,
"show_name": true
},
"cdp_mapping": [
{
"question_id": "<string>",
"target": "name",
"fill_policy": "fill_empty",
"subfield": "<string>",
"prefill_from_cdp": true
}
],
"advancedLogic": {
"allowedUrlParams": [
"<string>"
],
"variables": [
{
"name": "<string>",
"initial": 0
}
],
"startRules": [
{
"when": {
"mode": "all",
"conditions": [
{
"source": {
"kind": "answer",
"key": "<string>"
},
"operator": "equals",
"value": "<string>"
}
]
},
"destination": {
"kind": "next",
"questionId": "<string>"
}
}
],
"questionRules": [
{
"questionId": "<string>",
"hideWhen": {
"mode": "all",
"conditions": [
{
"source": {
"kind": "answer",
"key": "<string>"
},
"operator": "equals",
"value": "<string>"
}
]
},
"branches": [
{
"when": {
"mode": "all",
"conditions": [
{
"source": {
"kind": "answer",
"key": "<string>"
},
"operator": "equals",
"value": "<string>"
}
]
},
"destination": {
"kind": "next",
"questionId": "<string>"
}
}
],
"fallback": {
"kind": "next",
"questionId": "<string>"
},
"calculations": [
{
"operation": "set",
"target": "<string>",
"operand": {
"kind": "constant",
"value": "<string>"
},
"when": {
"mode": "all",
"conditions": [
{
"source": {
"kind": "answer",
"key": "<string>"
},
"operator": "equals",
"value": "<string>"
}
]
}
}
]
}
]
},
"logic": {},
"description": "<string>",
"domain": "<string>",
"mode": "universal",
"accent": "<string>",
"thankYou": "<string>",
"share": {
"expires_at": "2023-11-07T05:31:56Z",
"single_use": true,
"title": "<string>",
"description": "<string>",
"image_url": "<string>"
},
"controls": {
"responseCap": 0
},
"translations": {
"schemaVersion": 1,
"languages": {},
"updatedAt": "<string>"
},
"create_contacts": false
},
"branding": {
"name": "<string>",
"logo_url": "<string>",
"logo_alt": "<string>",
"show_logo": true,
"show_name": true
}
},
"session_id": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}⌘I
Open a published form and obtain a signed session
curl --request GET \
--url https://app.huechat.ai/api/v2/forms/{publicCode}import requests
url = "https://app.huechat.ai/api/v2/forms/{publicCode}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://app.huechat.ai/api/v2/forms/{publicCode}', 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://app.huechat.ai/api/v2/forms/{publicCode}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://app.huechat.ai/api/v2/forms/{publicCode}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.huechat.ai/api/v2/forms/{publicCode}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.huechat.ai/api/v2/forms/{publicCode}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"form": {
"title": "<string>",
"public_code": "<string>",
"version": 123,
"definition": {
"language": "en",
"questions": [
{
"id": "<string>",
"type": "welcome",
"title": "<string>",
"required": true,
"options": [
"<string>"
],
"rows": [
"<string>"
],
"columns": [
"<string>"
],
"min": 123,
"max": 123,
"score": {},
"description": "<string>",
"placeholder": "<string>",
"titleDelta": {
"ops": [
{
"insert": "<string>",
"attributes": {
"bold": true,
"italic": true,
"underline": true
}
}
]
},
"descriptionDelta": {
"ops": [
{
"insert": "<string>",
"attributes": {
"bold": true,
"italic": true,
"underline": true
}
}
]
},
"images": [
"<string>"
],
"mediaUrl": "<string>",
"mediaKind": "image",
"presentation": "text",
"randomize": true,
"currency": "<string>",
"amount": 5000000,
"redirectUrl": "<string>",
"schedule": {
"service_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resource_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"ai": {
"max_turns": 2
}
}
],
"branding": {
"name": "<string>",
"logo_url": "<string>",
"logo_alt": "<string>",
"show_logo": true,
"show_name": true
},
"cdp_mapping": [
{
"question_id": "<string>",
"target": "name",
"fill_policy": "fill_empty",
"subfield": "<string>",
"prefill_from_cdp": true
}
],
"advancedLogic": {
"allowedUrlParams": [
"<string>"
],
"variables": [
{
"name": "<string>",
"initial": 0
}
],
"startRules": [
{
"when": {
"mode": "all",
"conditions": [
{
"source": {
"kind": "answer",
"key": "<string>"
},
"operator": "equals",
"value": "<string>"
}
]
},
"destination": {
"kind": "next",
"questionId": "<string>"
}
}
],
"questionRules": [
{
"questionId": "<string>",
"hideWhen": {
"mode": "all",
"conditions": [
{
"source": {
"kind": "answer",
"key": "<string>"
},
"operator": "equals",
"value": "<string>"
}
]
},
"branches": [
{
"when": {
"mode": "all",
"conditions": [
{
"source": {
"kind": "answer",
"key": "<string>"
},
"operator": "equals",
"value": "<string>"
}
]
},
"destination": {
"kind": "next",
"questionId": "<string>"
}
}
],
"fallback": {
"kind": "next",
"questionId": "<string>"
},
"calculations": [
{
"operation": "set",
"target": "<string>",
"operand": {
"kind": "constant",
"value": "<string>"
},
"when": {
"mode": "all",
"conditions": [
{
"source": {
"kind": "answer",
"key": "<string>"
},
"operator": "equals",
"value": "<string>"
}
]
}
}
]
}
]
},
"logic": {},
"description": "<string>",
"domain": "<string>",
"mode": "universal",
"accent": "<string>",
"thankYou": "<string>",
"share": {
"expires_at": "2023-11-07T05:31:56Z",
"single_use": true,
"title": "<string>",
"description": "<string>",
"image_url": "<string>"
},
"controls": {
"responseCap": 0
},
"translations": {
"schemaVersion": 1,
"languages": {},
"updatedAt": "<string>"
},
"create_contacts": false
},
"branding": {
"name": "<string>",
"logo_url": "<string>",
"logo_alt": "<string>",
"show_logo": true,
"show_name": true
}
},
"session_id": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}
