Settings
Create saved field
Create a new saved field preset. Saved fields store reusable field configurations that can be applied to template fields.
POST
/
api
/
settings
/
saved_fields
Create saved field
curl --request POST \
--url https://spitshake.io/api/settings/saved_fields \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"name": "<string>",
"pattern": "<string>",
"options": [
"<string>"
],
"required": false
}
'import requests
url = "https://spitshake.io/api/settings/saved_fields"
payload = {
"name": "<string>",
"pattern": "<string>",
"options": ["<string>"],
"required": False
}
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', pattern: '<string>', options: ['<string>'], required: false})
};
fetch('https://spitshake.io/api/settings/saved_fields', 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://spitshake.io/api/settings/saved_fields",
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([
'name' => '<string>',
'pattern' => '<string>',
'options' => [
'<string>'
],
'required' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Auth-Token: <api-key>"
],
]);
$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://spitshake.io/api/settings/saved_fields"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"pattern\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"required\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Auth-Token", "<api-key>")
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://spitshake.io/api/settings/saved_fields")
.header("X-Auth-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"pattern\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"required\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://spitshake.io/api/settings/saved_fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Auth-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"pattern\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"required\": false\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"type": "<string>",
"validation": "<string>",
"pattern": "<string>",
"options": [
"<string>"
],
"required": true,
"created_at": "2023-11-07T05:31:56Z"
}{
"error": "<string>"
}Authorizations
ApiTokenSessionCookie
API token generated at Settings > API
Body
application/json
Display name of the saved field
Available options:
text, signature, initials, date, date_now, checkbox, select, radio, file, image, stamp, payment, phone_verification, cells, number Available options:
ssn, ein, email, url, zip, zip_us, numeric, alpha, alphanumeric, phone_us, phone_intl Custom regex pattern for field validation
Options for select/radio field types
⌘I
Create saved field
curl --request POST \
--url https://spitshake.io/api/settings/saved_fields \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"name": "<string>",
"pattern": "<string>",
"options": [
"<string>"
],
"required": false
}
'import requests
url = "https://spitshake.io/api/settings/saved_fields"
payload = {
"name": "<string>",
"pattern": "<string>",
"options": ["<string>"],
"required": False
}
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', pattern: '<string>', options: ['<string>'], required: false})
};
fetch('https://spitshake.io/api/settings/saved_fields', 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://spitshake.io/api/settings/saved_fields",
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([
'name' => '<string>',
'pattern' => '<string>',
'options' => [
'<string>'
],
'required' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Auth-Token: <api-key>"
],
]);
$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://spitshake.io/api/settings/saved_fields"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"pattern\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"required\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Auth-Token", "<api-key>")
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://spitshake.io/api/settings/saved_fields")
.header("X-Auth-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"pattern\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"required\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://spitshake.io/api/settings/saved_fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Auth-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"pattern\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"required\": false\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"type": "<string>",
"validation": "<string>",
"pattern": "<string>",
"options": [
"<string>"
],
"required": true,
"created_at": "2023-11-07T05:31:56Z"
}{
"error": "<string>"
}
