Skip to main content
POST
/
ca
/
api
/
v1
/
custom-fields
Create Custom Field
curl --request POST \
  --url https://api.meetcampfire.com/ca/api/v1/custom-fields \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "label": "<string>",
  "options": "<unknown>",
  "is_required": true,
  "display_order": -1,
  "is_active": true,
  "include_on_invoice": true
}
'
import requests

url = "https://api.meetcampfire.com/ca/api/v1/custom-fields"

payload = {
"name": "<string>",
"label": "<string>",
"options": "<unknown>",
"is_required": True,
"display_order": -1,
"is_active": True,
"include_on_invoice": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
label: '<string>',
options: '<unknown>',
is_required: true,
display_order: -1,
is_active: true,
include_on_invoice: true
})
};

fetch('https://api.meetcampfire.com/ca/api/v1/custom-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://api.meetcampfire.com/ca/api/v1/custom-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>',
'label' => '<string>',
'options' => '<unknown>',
'is_required' => true,
'display_order' => -1,
'is_active' => true,
'include_on_invoice' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);

$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://api.meetcampfire.com/ca/api/v1/custom-fields"

payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"options\": \"<unknown>\",\n \"is_required\": true,\n \"display_order\": -1,\n \"is_active\": true,\n \"include_on_invoice\": true\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "<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://api.meetcampfire.com/ca/api/v1/custom-fields")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"options\": \"<unknown>\",\n \"is_required\": true,\n \"display_order\": -1,\n \"is_active\": true,\n \"include_on_invoice\": true\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.meetcampfire.com/ca/api/v1/custom-fields")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"options\": \"<unknown>\",\n \"is_required\": true,\n \"display_order\": -1,\n \"is_active\": true,\n \"include_on_invoice\": true\n}"

response = http.request(request)
puts response.read_body
{
  "id": 123,
  "app": "<string>",
  "model": "<string>",
  "name": "<string>",
  "label": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "last_modified_at": "2023-11-07T05:31:56Z",
  "is_deleted": false,
  "deleted_at": "2023-11-07T05:31:56Z",
  "options": "<unknown>",
  "is_required": true,
  "display_order": -1,
  "is_active": true,
  "include_on_invoice": true
}

Authorizations

Authorization
string
header
required

Token-based authentication with required prefix "Token"

Body

name
string
required
Maximum string length: 100
label
string
required
Maximum string length: 100
field_type
enum<string>
required
  • text - Free Text
  • single_select - Single Select
  • date - Date
  • number - Number
  • boolean - Boolean
Available options:
text,
single_select,
date,
number,
boolean
options
any
is_required
boolean
display_order
integer
Required range: -2147483648 <= x <= 2147483647
is_active
boolean
include_on_invoice
boolean

Response

201 - application/json
id
integer
required
read-only
app
string
required
read-only
model
string
required
read-only
name
string
required
Maximum string length: 100
label
string
required
Maximum string length: 100
field_type
enum<string>
required
  • text - Free Text
  • single_select - Single Select
  • date - Date
  • number - Number
  • boolean - Boolean
Available options:
text,
single_select,
date,
number,
boolean
created_at
string<date-time>
required
read-only
updated_at
string<date-time>
required
read-only
last_modified_at
string<date-time>
required
read-only
is_deleted
boolean
default:false
required
read-only
deleted_at
string<date-time> | null
required
read-only
options
any
is_required
boolean
display_order
integer
Required range: -2147483648 <= x <= 2147483647
is_active
boolean
include_on_invoice
boolean