Forms
Upload a signed respondent attachment
Signed session headers bind file to tenant, form, immutable version and question. 20 MiB/file ; 10 files or 50 MiB/session ; 1,000 or 1 GiB/form/UTC day; positive question.max adds MiB limit. Accepted inspected images/PDF/text/CSV/audio/video; no SVG/HTML/scripts/archives. video_audio accepts media only. Store returned receipt unchanged.
POST
/
api
/
v2
/
forms
/
{publicCode}
/
assets
Upload a signed respondent attachment
curl --request POST \
--url https://app.huechat.ai/api/v2/forms/{publicCode}/assets \
--header 'Content-Type: multipart/form-data' \
--header 'X-Form-Session: <x-form-session>' \
--form file='@example-file' \
--form 'question_id=<string>'import requests
url = "https://app.huechat.ai/api/v2/forms/{publicCode}/assets"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "question_id": "<string>" }
headers = {"X-Form-Session": "<x-form-session>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('question_id', '<string>');
const options = {method: 'POST', headers: {'X-Form-Session': '<x-form-session>'}};
options.body = form;
fetch('https://app.huechat.ai/api/v2/forms/{publicCode}/assets', 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}/assets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"question_id\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"X-Form-Session: <x-form-session>"
],
]);
$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://app.huechat.ai/api/v2/forms/{publicCode}/assets"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"question_id\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Form-Session", "<x-form-session>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.huechat.ai/api/v2/forms/{publicCode}/assets")
.header("X-Form-Session", "<x-form-session>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"question_id\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.huechat.ai/api/v2/forms/{publicCode}/assets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Form-Session"] = '<x-form-session>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"question_id\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"asset": {
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"filename": "<string>",
"mime_type": "<string>",
"byte_size": 10485760
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Headers
Signed session from GET /forms/{publicCode}.
Invitation bearer token when using a recipient link.
Path Parameters
Required string length:
8 - 24Response
Success
Show child attributes
Show child attributes
⌘I
Upload a signed respondent attachment
curl --request POST \
--url https://app.huechat.ai/api/v2/forms/{publicCode}/assets \
--header 'Content-Type: multipart/form-data' \
--header 'X-Form-Session: <x-form-session>' \
--form file='@example-file' \
--form 'question_id=<string>'import requests
url = "https://app.huechat.ai/api/v2/forms/{publicCode}/assets"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "question_id": "<string>" }
headers = {"X-Form-Session": "<x-form-session>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('question_id', '<string>');
const options = {method: 'POST', headers: {'X-Form-Session': '<x-form-session>'}};
options.body = form;
fetch('https://app.huechat.ai/api/v2/forms/{publicCode}/assets', 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}/assets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"question_id\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"X-Form-Session: <x-form-session>"
],
]);
$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://app.huechat.ai/api/v2/forms/{publicCode}/assets"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"question_id\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Form-Session", "<x-form-session>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.huechat.ai/api/v2/forms/{publicCode}/assets")
.header("X-Form-Session", "<x-form-session>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"question_id\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.huechat.ai/api/v2/forms/{publicCode}/assets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Form-Session"] = '<x-form-session>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"question_id\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"asset": {
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"filename": "<string>",
"mime_type": "<string>",
"byte_size": 10485760
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}
