Form Templates
List all form templates
GET
/
form_templates
cURL
curl --request GET \
--url https://api.caspen.com/v1/form_templatesimport requests
url = "https://api.caspen.com/v1/form_templates"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.caspen.com/v1/form_templates', 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.caspen.com/v1/form_templates",
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://api.caspen.com/v1/form_templates"
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://api.caspen.com/v1/form_templates")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.caspen.com/v1/form_templates")
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{
"data": [
{
"id": "<string>",
"category_id": "<string>",
"name": "<string>",
"published": true,
"color": "<string>",
"completion_message": "<string>",
"prefill_client_fields": true,
"override_client_fields": true,
"send_client_notification": true,
"send_user_notification": true,
"attach_pdf_to_user_notification": true,
"notification_user_ids": [
"<string>"
],
"reminders_enabled": true,
"content": [
{
"sections": [
{
"title": "<string>",
"description": "<string>",
"questions": [
{}
]
}
]
}
],
"hosted_url": "<string>",
"tag_ids": [
"<string>"
],
"archived_at": "<string>",
"created_at": "<string>"
}
],
"links": {
"prev": "<string>",
"next": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}⌘I
cURL
curl --request GET \
--url https://api.caspen.com/v1/form_templatesimport requests
url = "https://api.caspen.com/v1/form_templates"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.caspen.com/v1/form_templates', 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.caspen.com/v1/form_templates",
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://api.caspen.com/v1/form_templates"
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://api.caspen.com/v1/form_templates")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.caspen.com/v1/form_templates")
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{
"data": [
{
"id": "<string>",
"category_id": "<string>",
"name": "<string>",
"published": true,
"color": "<string>",
"completion_message": "<string>",
"prefill_client_fields": true,
"override_client_fields": true,
"send_client_notification": true,
"send_user_notification": true,
"attach_pdf_to_user_notification": true,
"notification_user_ids": [
"<string>"
],
"reminders_enabled": true,
"content": [
{
"sections": [
{
"title": "<string>",
"description": "<string>",
"questions": [
{}
]
}
]
}
],
"hosted_url": "<string>",
"tag_ids": [
"<string>"
],
"archived_at": "<string>",
"created_at": "<string>"
}
],
"links": {
"prev": "<string>",
"next": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}