Custom fields
Custom field definitions - what the flexible fields on this install are called, what they accept, and which resource each belongs to. Hand-built: the engine must not serve flexfield generically, because a generic read would return the definitions this endpoint deliberately hides.
The object#
| Field | Type | Description |
|---|---|---|
| id | integer | NolaPro id of the definition. |
| keyrequest-only | string(100) | The name to use when reading or writing this field's value. Given, not derived. Published from flexfield.internalname, not a column of that name. |
| resourcerequest-only | string(60) | The API resource this field is attached to, e.g. customers. Published from flexfield.tablename, not a column of that name. |
| tablerequest-only | string(100) | The underlying table. Published from flexfield.tablename, not a column of that name. |
| labelrequest-only | text | What the screens call it. Published from flexfield.displayname, not a column of that name. |
| typerequest-only | string(20) | One of text, select, checkbox, date, radio, textarea, integer, number, file, url, phone. Published from flexfield.fieldtype, not a column of that name. |
| required | boolean | The screens refuse to save without it. |
| readonly | boolean | Displayed but not editable. |
| defaultrequest-only | string(255) | Value used when none is given. Published from flexfield.defaultvalue, not a column of that name. |
| sortorder | integer | Display order. |
| notes | string(255) | Help text shown beside the field. |
| options | array of object | Allowed values, for select and radio fields. |
Endpoints#
The custom fields configured on this install.
What custom fields exist, what type each is, whether it is required, and - for a select - the values it accepts.
Values alone are not usable: receiving {"warranty_code": "AX-9"} tells you nothing about whether that field is required or what it accepts, and you would find out by having a write rejected. Read this first.
key is the name to use, and it is given rather than derived. Most fields carry an internal name; a few do not, and those get a stable custom_<id> instead. Do not build the key yourself.
Fields NolaPro marks as hidden are excluded - the screens do not show them and neither does this.
Requires scope customers:read.
| Name | In | Type | Notes |
|---|---|---|---|
| resource | query | string | Limit to one resource, e.g. customers. An unknown name is refused rather than answered with an empty page. |
| Status | Code | Meaning |
|---|---|---|
| 422 | unknown_value | The resource named does not exist. |
curl \ 'https://acme.nolapro.com/!/api/v2/customfields' \ -H 'Authorization: Bearer $NP_TOKEN'
$ch = curl_init('https://acme.nolapro.com/!/api/v2/customfields'); curl_setopt_array($ch, [ CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('NP_TOKEN')], CURLOPT_RETURNTRANSFER => true, ]); $res = json_decode(curl_exec($ch), true);
import os, requests r = requests.get( "https://acme.nolapro.com/!/api/v2/customfields", headers={"Authorization": f"Bearer {os.environ['NP_TOKEN']}"}, ) r.raise_for_status()
const res = await fetch( 'https://acme.nolapro.com/!/api/v2/customfields', { method: 'GET', headers: { Authorization: `Bearer ${process.env.NP_TOKEN}` }, } ); const data = await res.json();
using System.Net.Http.Json; var token = Environment.GetEnvironmentVariable("NP_TOKEN"); using var http = new HttpClient(); http.DefaultRequestHeaders.Add("Authorization", "Bearer " + token); var res = await http.GetAsync( "https://acme.nolapro.com/!/api/v2/customfields"); res.EnsureSuccessStatusCode();