Add a form block
curl --request POST \
--url https://api.onlyform.com/v1/forms/{formId}/blocks \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"block": {
"id": "<string>",
"label": "<string>",
"description": "<string>",
"required": true,
"properties": {
"buttonText": "<string>",
"buttonLink": "<string>",
"shareButtons": true,
"maxChars": 0,
"min": 123,
"max": 123,
"minVal": true,
"maxVal": true,
"dateSeparator": "<string>",
"disabledDays": 5,
"beforeDate": "2023-11-07T05:31:56Z",
"afterDate": "2023-11-07T05:31:56Z",
"specificDates": [
"2023-11-07T05:31:56Z"
],
"weekStartsOn": 4,
"quotationMarks": true,
"multiSelection": true,
"randomize": true,
"alphaOrder": true,
"defaultCountry": "<string>",
"from": 123,
"to": 123,
"scaleStep": 123,
"limit": 2,
"currency": "<string>",
"amount": "<string>",
"paymentGateway": "<string>",
"showFields": true,
"showDatePicker": true,
"showLabels": true,
"superSize": true,
"otherOption": true,
"otherText": "<string>",
"horizontalAlign": true,
"verticalAlign": true,
"perRow": 2,
"altText": true,
"imageAlt": "<string>",
"imageWidth": 123,
"firstLabel": "<string>",
"secondLabel": "<string>",
"thirdLabel": "<string>",
"leftLabel": true,
"centerLabel": true,
"rightLabel": true,
"addressOrContact": {
"firstName": {
"hide": true,
"required": true
},
"lastName": {
"hide": true,
"required": true
},
"email": {
"hide": true,
"required": true
},
"phone": {
"hide": true,
"required": true
},
"company": {
"hide": true,
"required": true
},
"address": {
"hide": true,
"required": true
},
"address2": {
"hide": true,
"required": true
},
"city": {
"hide": true,
"required": true
},
"state": {
"hide": true,
"required": true
},
"zip": {
"hide": true,
"required": true
},
"country": {
"hide": true,
"required": true
}
},
"legalText": "<string>",
"legalStopFurther": true,
"showSeconds": true,
"showTimePicker": true,
"videoLink": "<string>",
"pdfLink": "<string>",
"embedLink": "<string>",
"placeholderText": "<string>",
"numberFormat": "<string>",
"allowedFiles": [
"<string>"
],
"multipleFiles": true,
"maxFileSize": true,
"hide": true,
"showActions": true,
"colorOption": true,
"rule": {},
"image": {}
},
"part_of": "<string>",
"row_id": "<string>",
"choices": [
{
"id": "<string>",
"label": "<string>",
"image": "<unknown>",
"color": "<string>",
"row_id": "<string>",
"alt": "<string>"
}
],
"children": "<array>",
"matrix_columns": [
{
"id": "<string>",
"label": "<string>",
"image": "<unknown>",
"color": "<string>",
"row_id": "<string>",
"alt": "<string>"
}
],
"matrix_rows": [
{
"id": "<string>",
"label": "<string>",
"image": "<unknown>",
"color": "<string>",
"row_id": "<string>",
"alt": "<string>"
}
]
}
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
block: {
id: '<string>',
label: '<string>',
description: '<string>',
required: true,
properties: {
buttonText: '<string>',
buttonLink: '<string>',
shareButtons: true,
maxChars: 0,
min: 123,
max: 123,
minVal: true,
maxVal: true,
dateSeparator: '<string>',
disabledDays: 5,
beforeDate: '2023-11-07T05:31:56Z',
afterDate: '2023-11-07T05:31:56Z',
specificDates: ['2023-11-07T05:31:56Z'],
weekStartsOn: 4,
quotationMarks: true,
multiSelection: true,
randomize: true,
alphaOrder: true,
defaultCountry: '<string>',
from: 123,
to: 123,
scaleStep: 123,
limit: 2,
currency: '<string>',
amount: '<string>',
paymentGateway: '<string>',
showFields: true,
showDatePicker: true,
showLabels: true,
superSize: true,
otherOption: true,
otherText: '<string>',
horizontalAlign: true,
verticalAlign: true,
perRow: 2,
altText: true,
imageAlt: '<string>',
imageWidth: 123,
firstLabel: '<string>',
secondLabel: '<string>',
thirdLabel: '<string>',
leftLabel: true,
centerLabel: true,
rightLabel: true,
addressOrContact: {
firstName: {hide: true, required: true},
lastName: {hide: true, required: true},
email: {hide: true, required: true},
phone: {hide: true, required: true},
company: {hide: true, required: true},
address: {hide: true, required: true},
address2: {hide: true, required: true},
city: {hide: true, required: true},
state: {hide: true, required: true},
zip: {hide: true, required: true},
country: {hide: true, required: true}
},
legalText: '<string>',
legalStopFurther: true,
showSeconds: true,
showTimePicker: true,
videoLink: '<string>',
pdfLink: '<string>',
embedLink: '<string>',
placeholderText: '<string>',
numberFormat: '<string>',
allowedFiles: ['<string>'],
multipleFiles: true,
maxFileSize: true,
hide: true,
showActions: true,
colorOption: true,
rule: {},
image: {}
},
part_of: '<string>',
row_id: '<string>',
choices: [
{
id: '<string>',
label: '<string>',
image: '<unknown>',
color: '<string>',
row_id: '<string>',
alt: '<string>'
}
],
children: '<array>',
matrix_columns: [
{
id: '<string>',
label: '<string>',
image: '<unknown>',
color: '<string>',
row_id: '<string>',
alt: '<string>'
}
],
matrix_rows: [
{
id: '<string>',
label: '<string>',
image: '<unknown>',
color: '<string>',
row_id: '<string>',
alt: '<string>'
}
]
}
})
};
fetch('https://api.onlyform.com/v1/forms/{formId}/blocks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.onlyform.com/v1/forms/{formId}/blocks"
payload = { "block": {
"id": "<string>",
"label": "<string>",
"description": "<string>",
"required": True,
"properties": {
"buttonText": "<string>",
"buttonLink": "<string>",
"shareButtons": True,
"maxChars": 0,
"min": 123,
"max": 123,
"minVal": True,
"maxVal": True,
"dateSeparator": "<string>",
"disabledDays": 5,
"beforeDate": "2023-11-07T05:31:56Z",
"afterDate": "2023-11-07T05:31:56Z",
"specificDates": ["2023-11-07T05:31:56Z"],
"weekStartsOn": 4,
"quotationMarks": True,
"multiSelection": True,
"randomize": True,
"alphaOrder": True,
"defaultCountry": "<string>",
"from": 123,
"to": 123,
"scaleStep": 123,
"limit": 2,
"currency": "<string>",
"amount": "<string>",
"paymentGateway": "<string>",
"showFields": True,
"showDatePicker": True,
"showLabels": True,
"superSize": True,
"otherOption": True,
"otherText": "<string>",
"horizontalAlign": True,
"verticalAlign": True,
"perRow": 2,
"altText": True,
"imageAlt": "<string>",
"imageWidth": 123,
"firstLabel": "<string>",
"secondLabel": "<string>",
"thirdLabel": "<string>",
"leftLabel": True,
"centerLabel": True,
"rightLabel": True,
"addressOrContact": {
"firstName": {
"hide": True,
"required": True
},
"lastName": {
"hide": True,
"required": True
},
"email": {
"hide": True,
"required": True
},
"phone": {
"hide": True,
"required": True
},
"company": {
"hide": True,
"required": True
},
"address": {
"hide": True,
"required": True
},
"address2": {
"hide": True,
"required": True
},
"city": {
"hide": True,
"required": True
},
"state": {
"hide": True,
"required": True
},
"zip": {
"hide": True,
"required": True
},
"country": {
"hide": True,
"required": True
}
},
"legalText": "<string>",
"legalStopFurther": True,
"showSeconds": True,
"showTimePicker": True,
"videoLink": "<string>",
"pdfLink": "<string>",
"embedLink": "<string>",
"placeholderText": "<string>",
"numberFormat": "<string>",
"allowedFiles": ["<string>"],
"multipleFiles": True,
"maxFileSize": True,
"hide": True,
"showActions": True,
"colorOption": True,
"rule": {},
"image": {}
},
"part_of": "<string>",
"row_id": "<string>",
"choices": [
{
"id": "<string>",
"label": "<string>",
"image": "<unknown>",
"color": "<string>",
"row_id": "<string>",
"alt": "<string>"
}
],
"children": "<array>",
"matrix_columns": [
{
"id": "<string>",
"label": "<string>",
"image": "<unknown>",
"color": "<string>",
"row_id": "<string>",
"alt": "<string>"
}
],
"matrix_rows": [
{
"id": "<string>",
"label": "<string>",
"image": "<unknown>",
"color": "<string>",
"row_id": "<string>",
"alt": "<string>"
}
]
} }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.onlyform.com/v1/forms/{formId}/blocks"
payload := strings.NewReader("{\n \"block\": {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"required\": true,\n \"properties\": {\n \"buttonText\": \"<string>\",\n \"buttonLink\": \"<string>\",\n \"shareButtons\": true,\n \"maxChars\": 0,\n \"min\": 123,\n \"max\": 123,\n \"minVal\": true,\n \"maxVal\": true,\n \"dateSeparator\": \"<string>\",\n \"disabledDays\": 5,\n \"beforeDate\": \"2023-11-07T05:31:56Z\",\n \"afterDate\": \"2023-11-07T05:31:56Z\",\n \"specificDates\": [\n \"2023-11-07T05:31:56Z\"\n ],\n \"weekStartsOn\": 4,\n \"quotationMarks\": true,\n \"multiSelection\": true,\n \"randomize\": true,\n \"alphaOrder\": true,\n \"defaultCountry\": \"<string>\",\n \"from\": 123,\n \"to\": 123,\n \"scaleStep\": 123,\n \"limit\": 2,\n \"currency\": \"<string>\",\n \"amount\": \"<string>\",\n \"paymentGateway\": \"<string>\",\n \"showFields\": true,\n \"showDatePicker\": true,\n \"showLabels\": true,\n \"superSize\": true,\n \"otherOption\": true,\n \"otherText\": \"<string>\",\n \"horizontalAlign\": true,\n \"verticalAlign\": true,\n \"perRow\": 2,\n \"altText\": true,\n \"imageAlt\": \"<string>\",\n \"imageWidth\": 123,\n \"firstLabel\": \"<string>\",\n \"secondLabel\": \"<string>\",\n \"thirdLabel\": \"<string>\",\n \"leftLabel\": true,\n \"centerLabel\": true,\n \"rightLabel\": true,\n \"addressOrContact\": {\n \"firstName\": {\n \"hide\": true,\n \"required\": true\n },\n \"lastName\": {\n \"hide\": true,\n \"required\": true\n },\n \"email\": {\n \"hide\": true,\n \"required\": true\n },\n \"phone\": {\n \"hide\": true,\n \"required\": true\n },\n \"company\": {\n \"hide\": true,\n \"required\": true\n },\n \"address\": {\n \"hide\": true,\n \"required\": true\n },\n \"address2\": {\n \"hide\": true,\n \"required\": true\n },\n \"city\": {\n \"hide\": true,\n \"required\": true\n },\n \"state\": {\n \"hide\": true,\n \"required\": true\n },\n \"zip\": {\n \"hide\": true,\n \"required\": true\n },\n \"country\": {\n \"hide\": true,\n \"required\": true\n }\n },\n \"legalText\": \"<string>\",\n \"legalStopFurther\": true,\n \"showSeconds\": true,\n \"showTimePicker\": true,\n \"videoLink\": \"<string>\",\n \"pdfLink\": \"<string>\",\n \"embedLink\": \"<string>\",\n \"placeholderText\": \"<string>\",\n \"numberFormat\": \"<string>\",\n \"allowedFiles\": [\n \"<string>\"\n ],\n \"multipleFiles\": true,\n \"maxFileSize\": true,\n \"hide\": true,\n \"showActions\": true,\n \"colorOption\": true,\n \"rule\": {},\n \"image\": {}\n },\n \"part_of\": \"<string>\",\n \"row_id\": \"<string>\",\n \"choices\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"image\": \"<unknown>\",\n \"color\": \"<string>\",\n \"row_id\": \"<string>\",\n \"alt\": \"<string>\"\n }\n ],\n \"children\": \"<array>\",\n \"matrix_columns\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"image\": \"<unknown>\",\n \"color\": \"<string>\",\n \"row_id\": \"<string>\",\n \"alt\": \"<string>\"\n }\n ],\n \"matrix_rows\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"image\": \"<unknown>\",\n \"color\": \"<string>\",\n \"row_id\": \"<string>\",\n \"alt\": \"<string>\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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))
}{
"id": "<string>",
"label": "<string>",
"description": "<string>",
"required": true,
"properties": {
"buttonText": "<string>",
"buttonLink": "<string>",
"shareButtons": true,
"maxChars": 0,
"min": 123,
"max": 123,
"minVal": true,
"maxVal": true,
"dateSeparator": "<string>",
"disabledDays": 5,
"beforeDate": "2023-11-07T05:31:56Z",
"afterDate": "2023-11-07T05:31:56Z",
"specificDates": [
"2023-11-07T05:31:56Z"
],
"weekStartsOn": 4,
"quotationMarks": true,
"multiSelection": true,
"randomize": true,
"alphaOrder": true,
"defaultCountry": "<string>",
"from": 123,
"to": 123,
"scaleStep": 123,
"limit": 2,
"currency": "<string>",
"amount": "<string>",
"paymentGateway": "<string>",
"showFields": true,
"showDatePicker": true,
"showLabels": true,
"superSize": true,
"otherOption": true,
"otherText": "<string>",
"horizontalAlign": true,
"verticalAlign": true,
"perRow": 2,
"altText": true,
"imageAlt": "<string>",
"imageWidth": 123,
"firstLabel": "<string>",
"secondLabel": "<string>",
"thirdLabel": "<string>",
"leftLabel": true,
"centerLabel": true,
"rightLabel": true,
"addressOrContact": {
"firstName": {
"hide": true,
"required": true
},
"lastName": {
"hide": true,
"required": true
},
"email": {
"hide": true,
"required": true
},
"phone": {
"hide": true,
"required": true
},
"company": {
"hide": true,
"required": true
},
"address": {
"hide": true,
"required": true
},
"address2": {
"hide": true,
"required": true
},
"city": {
"hide": true,
"required": true
},
"state": {
"hide": true,
"required": true
},
"zip": {
"hide": true,
"required": true
},
"country": {
"hide": true,
"required": true
}
},
"legalText": "<string>",
"legalStopFurther": true,
"showSeconds": true,
"showTimePicker": true,
"videoLink": "<string>",
"pdfLink": "<string>",
"embedLink": "<string>",
"placeholderText": "<string>",
"numberFormat": "<string>",
"allowedFiles": [
"<string>"
],
"multipleFiles": true,
"maxFileSize": true,
"hide": true,
"showActions": true,
"colorOption": true,
"rule": {},
"image": {}
},
"part_of": "<string>",
"row_id": "<string>",
"choices": [
{
"id": "<string>",
"label": "<string>",
"image": "<unknown>",
"color": "<string>",
"row_id": "<string>",
"alt": "<string>"
}
],
"children": "<array>",
"matrix_columns": [
{
"id": "<string>",
"label": "<string>",
"image": "<unknown>",
"color": "<string>",
"row_id": "<string>",
"alt": "<string>"
}
],
"matrix_rows": [
{
"id": "<string>",
"label": "<string>",
"image": "<unknown>",
"color": "<string>",
"row_id": "<string>",
"alt": "<string>"
}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}Forms
Add a form block
Adds a top-level question or content block at an optional position. Nested blocks belong in the parent group children array. Requires forms:write.
POST
https://api.onlyform.com
/
v1
/
forms
/
{formId}
/
blocks
Add a form block
curl --request POST \
--url https://api.onlyform.com/v1/forms/{formId}/blocks \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"block": {
"id": "<string>",
"label": "<string>",
"description": "<string>",
"required": true,
"properties": {
"buttonText": "<string>",
"buttonLink": "<string>",
"shareButtons": true,
"maxChars": 0,
"min": 123,
"max": 123,
"minVal": true,
"maxVal": true,
"dateSeparator": "<string>",
"disabledDays": 5,
"beforeDate": "2023-11-07T05:31:56Z",
"afterDate": "2023-11-07T05:31:56Z",
"specificDates": [
"2023-11-07T05:31:56Z"
],
"weekStartsOn": 4,
"quotationMarks": true,
"multiSelection": true,
"randomize": true,
"alphaOrder": true,
"defaultCountry": "<string>",
"from": 123,
"to": 123,
"scaleStep": 123,
"limit": 2,
"currency": "<string>",
"amount": "<string>",
"paymentGateway": "<string>",
"showFields": true,
"showDatePicker": true,
"showLabels": true,
"superSize": true,
"otherOption": true,
"otherText": "<string>",
"horizontalAlign": true,
"verticalAlign": true,
"perRow": 2,
"altText": true,
"imageAlt": "<string>",
"imageWidth": 123,
"firstLabel": "<string>",
"secondLabel": "<string>",
"thirdLabel": "<string>",
"leftLabel": true,
"centerLabel": true,
"rightLabel": true,
"addressOrContact": {
"firstName": {
"hide": true,
"required": true
},
"lastName": {
"hide": true,
"required": true
},
"email": {
"hide": true,
"required": true
},
"phone": {
"hide": true,
"required": true
},
"company": {
"hide": true,
"required": true
},
"address": {
"hide": true,
"required": true
},
"address2": {
"hide": true,
"required": true
},
"city": {
"hide": true,
"required": true
},
"state": {
"hide": true,
"required": true
},
"zip": {
"hide": true,
"required": true
},
"country": {
"hide": true,
"required": true
}
},
"legalText": "<string>",
"legalStopFurther": true,
"showSeconds": true,
"showTimePicker": true,
"videoLink": "<string>",
"pdfLink": "<string>",
"embedLink": "<string>",
"placeholderText": "<string>",
"numberFormat": "<string>",
"allowedFiles": [
"<string>"
],
"multipleFiles": true,
"maxFileSize": true,
"hide": true,
"showActions": true,
"colorOption": true,
"rule": {},
"image": {}
},
"part_of": "<string>",
"row_id": "<string>",
"choices": [
{
"id": "<string>",
"label": "<string>",
"image": "<unknown>",
"color": "<string>",
"row_id": "<string>",
"alt": "<string>"
}
],
"children": "<array>",
"matrix_columns": [
{
"id": "<string>",
"label": "<string>",
"image": "<unknown>",
"color": "<string>",
"row_id": "<string>",
"alt": "<string>"
}
],
"matrix_rows": [
{
"id": "<string>",
"label": "<string>",
"image": "<unknown>",
"color": "<string>",
"row_id": "<string>",
"alt": "<string>"
}
]
}
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
block: {
id: '<string>',
label: '<string>',
description: '<string>',
required: true,
properties: {
buttonText: '<string>',
buttonLink: '<string>',
shareButtons: true,
maxChars: 0,
min: 123,
max: 123,
minVal: true,
maxVal: true,
dateSeparator: '<string>',
disabledDays: 5,
beforeDate: '2023-11-07T05:31:56Z',
afterDate: '2023-11-07T05:31:56Z',
specificDates: ['2023-11-07T05:31:56Z'],
weekStartsOn: 4,
quotationMarks: true,
multiSelection: true,
randomize: true,
alphaOrder: true,
defaultCountry: '<string>',
from: 123,
to: 123,
scaleStep: 123,
limit: 2,
currency: '<string>',
amount: '<string>',
paymentGateway: '<string>',
showFields: true,
showDatePicker: true,
showLabels: true,
superSize: true,
otherOption: true,
otherText: '<string>',
horizontalAlign: true,
verticalAlign: true,
perRow: 2,
altText: true,
imageAlt: '<string>',
imageWidth: 123,
firstLabel: '<string>',
secondLabel: '<string>',
thirdLabel: '<string>',
leftLabel: true,
centerLabel: true,
rightLabel: true,
addressOrContact: {
firstName: {hide: true, required: true},
lastName: {hide: true, required: true},
email: {hide: true, required: true},
phone: {hide: true, required: true},
company: {hide: true, required: true},
address: {hide: true, required: true},
address2: {hide: true, required: true},
city: {hide: true, required: true},
state: {hide: true, required: true},
zip: {hide: true, required: true},
country: {hide: true, required: true}
},
legalText: '<string>',
legalStopFurther: true,
showSeconds: true,
showTimePicker: true,
videoLink: '<string>',
pdfLink: '<string>',
embedLink: '<string>',
placeholderText: '<string>',
numberFormat: '<string>',
allowedFiles: ['<string>'],
multipleFiles: true,
maxFileSize: true,
hide: true,
showActions: true,
colorOption: true,
rule: {},
image: {}
},
part_of: '<string>',
row_id: '<string>',
choices: [
{
id: '<string>',
label: '<string>',
image: '<unknown>',
color: '<string>',
row_id: '<string>',
alt: '<string>'
}
],
children: '<array>',
matrix_columns: [
{
id: '<string>',
label: '<string>',
image: '<unknown>',
color: '<string>',
row_id: '<string>',
alt: '<string>'
}
],
matrix_rows: [
{
id: '<string>',
label: '<string>',
image: '<unknown>',
color: '<string>',
row_id: '<string>',
alt: '<string>'
}
]
}
})
};
fetch('https://api.onlyform.com/v1/forms/{formId}/blocks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.onlyform.com/v1/forms/{formId}/blocks"
payload = { "block": {
"id": "<string>",
"label": "<string>",
"description": "<string>",
"required": True,
"properties": {
"buttonText": "<string>",
"buttonLink": "<string>",
"shareButtons": True,
"maxChars": 0,
"min": 123,
"max": 123,
"minVal": True,
"maxVal": True,
"dateSeparator": "<string>",
"disabledDays": 5,
"beforeDate": "2023-11-07T05:31:56Z",
"afterDate": "2023-11-07T05:31:56Z",
"specificDates": ["2023-11-07T05:31:56Z"],
"weekStartsOn": 4,
"quotationMarks": True,
"multiSelection": True,
"randomize": True,
"alphaOrder": True,
"defaultCountry": "<string>",
"from": 123,
"to": 123,
"scaleStep": 123,
"limit": 2,
"currency": "<string>",
"amount": "<string>",
"paymentGateway": "<string>",
"showFields": True,
"showDatePicker": True,
"showLabels": True,
"superSize": True,
"otherOption": True,
"otherText": "<string>",
"horizontalAlign": True,
"verticalAlign": True,
"perRow": 2,
"altText": True,
"imageAlt": "<string>",
"imageWidth": 123,
"firstLabel": "<string>",
"secondLabel": "<string>",
"thirdLabel": "<string>",
"leftLabel": True,
"centerLabel": True,
"rightLabel": True,
"addressOrContact": {
"firstName": {
"hide": True,
"required": True
},
"lastName": {
"hide": True,
"required": True
},
"email": {
"hide": True,
"required": True
},
"phone": {
"hide": True,
"required": True
},
"company": {
"hide": True,
"required": True
},
"address": {
"hide": True,
"required": True
},
"address2": {
"hide": True,
"required": True
},
"city": {
"hide": True,
"required": True
},
"state": {
"hide": True,
"required": True
},
"zip": {
"hide": True,
"required": True
},
"country": {
"hide": True,
"required": True
}
},
"legalText": "<string>",
"legalStopFurther": True,
"showSeconds": True,
"showTimePicker": True,
"videoLink": "<string>",
"pdfLink": "<string>",
"embedLink": "<string>",
"placeholderText": "<string>",
"numberFormat": "<string>",
"allowedFiles": ["<string>"],
"multipleFiles": True,
"maxFileSize": True,
"hide": True,
"showActions": True,
"colorOption": True,
"rule": {},
"image": {}
},
"part_of": "<string>",
"row_id": "<string>",
"choices": [
{
"id": "<string>",
"label": "<string>",
"image": "<unknown>",
"color": "<string>",
"row_id": "<string>",
"alt": "<string>"
}
],
"children": "<array>",
"matrix_columns": [
{
"id": "<string>",
"label": "<string>",
"image": "<unknown>",
"color": "<string>",
"row_id": "<string>",
"alt": "<string>"
}
],
"matrix_rows": [
{
"id": "<string>",
"label": "<string>",
"image": "<unknown>",
"color": "<string>",
"row_id": "<string>",
"alt": "<string>"
}
]
} }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.onlyform.com/v1/forms/{formId}/blocks"
payload := strings.NewReader("{\n \"block\": {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"required\": true,\n \"properties\": {\n \"buttonText\": \"<string>\",\n \"buttonLink\": \"<string>\",\n \"shareButtons\": true,\n \"maxChars\": 0,\n \"min\": 123,\n \"max\": 123,\n \"minVal\": true,\n \"maxVal\": true,\n \"dateSeparator\": \"<string>\",\n \"disabledDays\": 5,\n \"beforeDate\": \"2023-11-07T05:31:56Z\",\n \"afterDate\": \"2023-11-07T05:31:56Z\",\n \"specificDates\": [\n \"2023-11-07T05:31:56Z\"\n ],\n \"weekStartsOn\": 4,\n \"quotationMarks\": true,\n \"multiSelection\": true,\n \"randomize\": true,\n \"alphaOrder\": true,\n \"defaultCountry\": \"<string>\",\n \"from\": 123,\n \"to\": 123,\n \"scaleStep\": 123,\n \"limit\": 2,\n \"currency\": \"<string>\",\n \"amount\": \"<string>\",\n \"paymentGateway\": \"<string>\",\n \"showFields\": true,\n \"showDatePicker\": true,\n \"showLabels\": true,\n \"superSize\": true,\n \"otherOption\": true,\n \"otherText\": \"<string>\",\n \"horizontalAlign\": true,\n \"verticalAlign\": true,\n \"perRow\": 2,\n \"altText\": true,\n \"imageAlt\": \"<string>\",\n \"imageWidth\": 123,\n \"firstLabel\": \"<string>\",\n \"secondLabel\": \"<string>\",\n \"thirdLabel\": \"<string>\",\n \"leftLabel\": true,\n \"centerLabel\": true,\n \"rightLabel\": true,\n \"addressOrContact\": {\n \"firstName\": {\n \"hide\": true,\n \"required\": true\n },\n \"lastName\": {\n \"hide\": true,\n \"required\": true\n },\n \"email\": {\n \"hide\": true,\n \"required\": true\n },\n \"phone\": {\n \"hide\": true,\n \"required\": true\n },\n \"company\": {\n \"hide\": true,\n \"required\": true\n },\n \"address\": {\n \"hide\": true,\n \"required\": true\n },\n \"address2\": {\n \"hide\": true,\n \"required\": true\n },\n \"city\": {\n \"hide\": true,\n \"required\": true\n },\n \"state\": {\n \"hide\": true,\n \"required\": true\n },\n \"zip\": {\n \"hide\": true,\n \"required\": true\n },\n \"country\": {\n \"hide\": true,\n \"required\": true\n }\n },\n \"legalText\": \"<string>\",\n \"legalStopFurther\": true,\n \"showSeconds\": true,\n \"showTimePicker\": true,\n \"videoLink\": \"<string>\",\n \"pdfLink\": \"<string>\",\n \"embedLink\": \"<string>\",\n \"placeholderText\": \"<string>\",\n \"numberFormat\": \"<string>\",\n \"allowedFiles\": [\n \"<string>\"\n ],\n \"multipleFiles\": true,\n \"maxFileSize\": true,\n \"hide\": true,\n \"showActions\": true,\n \"colorOption\": true,\n \"rule\": {},\n \"image\": {}\n },\n \"part_of\": \"<string>\",\n \"row_id\": \"<string>\",\n \"choices\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"image\": \"<unknown>\",\n \"color\": \"<string>\",\n \"row_id\": \"<string>\",\n \"alt\": \"<string>\"\n }\n ],\n \"children\": \"<array>\",\n \"matrix_columns\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"image\": \"<unknown>\",\n \"color\": \"<string>\",\n \"row_id\": \"<string>\",\n \"alt\": \"<string>\"\n }\n ],\n \"matrix_rows\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"image\": \"<unknown>\",\n \"color\": \"<string>\",\n \"row_id\": \"<string>\",\n \"alt\": \"<string>\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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))
}{
"id": "<string>",
"label": "<string>",
"description": "<string>",
"required": true,
"properties": {
"buttonText": "<string>",
"buttonLink": "<string>",
"shareButtons": true,
"maxChars": 0,
"min": 123,
"max": 123,
"minVal": true,
"maxVal": true,
"dateSeparator": "<string>",
"disabledDays": 5,
"beforeDate": "2023-11-07T05:31:56Z",
"afterDate": "2023-11-07T05:31:56Z",
"specificDates": [
"2023-11-07T05:31:56Z"
],
"weekStartsOn": 4,
"quotationMarks": true,
"multiSelection": true,
"randomize": true,
"alphaOrder": true,
"defaultCountry": "<string>",
"from": 123,
"to": 123,
"scaleStep": 123,
"limit": 2,
"currency": "<string>",
"amount": "<string>",
"paymentGateway": "<string>",
"showFields": true,
"showDatePicker": true,
"showLabels": true,
"superSize": true,
"otherOption": true,
"otherText": "<string>",
"horizontalAlign": true,
"verticalAlign": true,
"perRow": 2,
"altText": true,
"imageAlt": "<string>",
"imageWidth": 123,
"firstLabel": "<string>",
"secondLabel": "<string>",
"thirdLabel": "<string>",
"leftLabel": true,
"centerLabel": true,
"rightLabel": true,
"addressOrContact": {
"firstName": {
"hide": true,
"required": true
},
"lastName": {
"hide": true,
"required": true
},
"email": {
"hide": true,
"required": true
},
"phone": {
"hide": true,
"required": true
},
"company": {
"hide": true,
"required": true
},
"address": {
"hide": true,
"required": true
},
"address2": {
"hide": true,
"required": true
},
"city": {
"hide": true,
"required": true
},
"state": {
"hide": true,
"required": true
},
"zip": {
"hide": true,
"required": true
},
"country": {
"hide": true,
"required": true
}
},
"legalText": "<string>",
"legalStopFurther": true,
"showSeconds": true,
"showTimePicker": true,
"videoLink": "<string>",
"pdfLink": "<string>",
"embedLink": "<string>",
"placeholderText": "<string>",
"numberFormat": "<string>",
"allowedFiles": [
"<string>"
],
"multipleFiles": true,
"maxFileSize": true,
"hide": true,
"showActions": true,
"colorOption": true,
"rule": {},
"image": {}
},
"part_of": "<string>",
"row_id": "<string>",
"choices": [
{
"id": "<string>",
"label": "<string>",
"image": "<unknown>",
"color": "<string>",
"row_id": "<string>",
"alt": "<string>"
}
],
"children": "<array>",
"matrix_columns": [
{
"id": "<string>",
"label": "<string>",
"image": "<unknown>",
"color": "<string>",
"row_id": "<string>",
"alt": "<string>"
}
],
"matrix_rows": [
{
"id": "<string>",
"label": "<string>",
"image": "<unknown>",
"color": "<string>",
"row_id": "<string>",
"alt": "<string>"
}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}Authorizations
A scoped key with the of_live_ prefix, generated from Profile > API keys.
Headers
ETag returned by a form or block read. Prevents overwriting a newer form revision.
Path Parameters
Pattern:
^[0-9a-fA-F]{24}$Example:
"507f1f77bcf86cd799439011"
Body
application/json
Response
Block created.
Stable caller-supplied block ID.
Available options:
welcome, ending, date, file-upload, phone-number, email, website, payment, statement, group, short-text, long-text, ranking, opinion-scale, rating, matrix, number, multiple-choice, picture-choice, yes-no, dropdown, legal, address, contact-info, time, color, currency, slider, gate, signature, coordinates, captcha, video, pdf, text, divider, label, heading-1, heading-2, heading-3, page-break, logic, hidden-field, image, audio, checkboxes Type-specific block settings. Unsupported combinations are ignored by the renderer.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
⌘I