Difference between revisions of "API:CustomFields:Get"

From docs
Jump to: navigation, search
(Created page with " == API » Get Custom Fields == '''URL:''' <nowiki>https://app.callproof.com/api/custom_fields/get/</nowiki> '''Method:''' GET '''Required Fields:''' * '''''key'''...")
 
 
Line 2: Line 2:
 
== [[API]] &#187; Get Custom Fields ==
 
== [[API]] &#187; Get Custom Fields ==
  
'''URL:''' <nowiki>https://app.callproof.com/api/custom_fields/get/</nowiki>
+
=== Base URL ===
 +
https://app.callproof.com
  
'''Method:''' GET
+
=== Endpoint ===
 +
/api/custom_fields/get/
  
'''Required Fields:'''
+
=== Purpose ===
 +
Retrieves the custom field definitions configured for contacts in your CallProof company. Use this to understand which custom fields are available for contacts, including field names, field types, display order, default options, and selectable option values.
  
* '''''key''''' - API Key
+
=== HTTP Method ===
* '''''secret''''' - API Key Secret
+
GET
  
'''Optional Fields:'''
+
=== Headers ===
 +
No required headers.
  
None
+
{| class="wikitable"
 +
! Header !! Required !! Description
 +
|-
 +
| — || — || No headers are required for this endpoint. Authentication is provided via query parameters.
 +
|}
  
'''Data Returned:'''
+
=== Security ===
 +
* '''Yes''' – Requires a valid API key and secret with permission to read custom fields.
  
* '''''results''''' - Custom Fields
+
=== Parameters ===
* '''''errors''''' - Array of errors produced by the request
+
 
* '''''code''''' - HTTP request status
+
==== Path Parameters ====
 +
None.
 +
 
 +
==== Query Parameters ====
 +
{| class="wikitable"
 +
! Parameter !! Type !! Required !! Description
 +
|-
 +
| key || string || Yes || Public API key assigned to your CallProof account.
 +
|-
 +
| secret || string || Yes || Private API secret paired with the API key.
 +
|}
 +
 
 +
==== Request Body ====
 +
None.
 +
 
 +
=== cURL Example ===
 +
<pre>
 +
curl -X GET "https://app.callproof.com/api/custom_fields/get/?key=YOUR_API_KEY&secret=YOUR_API_SECRET"
 +
</pre>
 +
 
 +
=== Successful Response (200) ===
 +
Returns the contact custom fields configured for your company, ordered by their display position.
 +
 
 +
{| class="wikitable"
 +
! Field !! Type !! Description
 +
|-
 +
| results || array || List of contact custom field definitions.
 +
|-
 +
| results[].id || integer || Unique identifier for the custom field.
 +
|-
 +
| results[].name || string || Custom field display name.
 +
|-
 +
| results[].cfield_table || string || Business area where the custom field is used. For this endpoint, this is contact-related.
 +
|-
 +
| results[].cfield_type || string || Type of custom field, such as text, date, select, or another configured type.
 +
|-
 +
| results[].cfield_option_default || string || Default option name for fields that support default options. Empty when no default is configured.
 +
|-
 +
| results[].rfield || string || Related regular field name, when applicable.
 +
|-
 +
| results[].cfield || string || Parent or linked custom field name, when applicable.
 +
|-
 +
| results[].position || integer || Display order position.
 +
|-
 +
| results[].points || integer || Points value assigned to the field.
 +
|-
 +
| results[].hide_on_checkout || string || <code>1</code> if hidden during checkout; otherwise <code>0</code>.
 +
|-
 +
| results[].options || array || Selectable options configured for the custom field.
 +
|-
 +
| results[].options[].id || integer || Unique identifier for the option.
 +
|-
 +
| results[].options[].name || string || Option display name.
 +
|-
 +
| results[].options[].cfield_id || integer || Identifier of the custom field that owns the option.
 +
|-
 +
| results[].options[].cfield || string || Name of the custom field that owns the option.
 +
|-
 +
| results[].options[].is_default || string || <code>1</code> if this option is a default option; otherwise <code>0</code>.
 +
|-
 +
| results[].options[].position || integer || Option display order position.
 +
|-
 +
| results[].options[].points || integer || Points value assigned to the option.
 +
|-
 +
| errors || array || Empty list when the request succeeds.
 +
|-
 +
| code || integer || HTTP-style status value; <code>200</code> on success.
 +
|}
 +
 
 +
Example response:
 +
<pre>
 +
{
 +
  "results": [
 +
    {
 +
      "id": 12,
 +
      "name": "Industry",
 +
      "cfield_table": "contact",
 +
      "cfield_type": "select",
 +
      "cfield_option_default": "Manufacturing",
 +
      "rfield": "",
 +
      "cfield": "",
 +
      "position": 1,
 +
      "points": 0,
 +
      "hide_on_checkout": "0",
 +
      "options": [
 +
        {
 +
          "id": 101,
 +
          "name": "Manufacturing",
 +
          "cfield_id": 12,
 +
          "cfield": "Industry",
 +
          "is_default": "1",
 +
          "position": 1,
 +
          "points": 0
 +
        }
 +
      ]
 +
    }
 +
  ],
 +
  "errors": [],
 +
  "code": 200
 +
}
 +
</pre>
 +
 
 +
=== Notes ===
 +
* This endpoint returns contact custom field definitions, not custom field values for a specific contact.
 +
* Results are ordered by custom field position.
 +
* Only custom fields belonging to your company are returned.
 +
* Option lists are included for fields that have selectable options.
 +
* If no contact custom fields are configured, the response returns an empty <code>results</code> list with status <code>200</code>.
 +
* Use <code>/api/contact/custom_fields/update/</code> to update custom field values for a specific contact.
 +
 
 +
=== Error Responses ===
 +
{| class="wikitable"
 +
! Status Code !! Meaning
 +
|-
 +
| 401 || Unauthorized – The API key and/or secret is missing, invalid, inactive, associated with a disabled account, or lacks permission to read custom fields.
 +
|-
 +
| 405 || Method Not Allowed – A method other than GET was used.
 +
|-
 +
| 500 || Internal Server Error – An unexpected server problem occurred. Not specified in Swagger.
 +
|}
 +
 
 +
'''401 response body example:'''
 +
<pre>
 +
{
 +
  "results": [],
 +
  "errors": ["Invalid API Key"],
 +
  "code": 401
 +
}
 +
</pre>
 +
 
 +
'''405 response body example:'''
 +
<pre>
 +
{
 +
  "results": [],
 +
  "errors": ["Method not allowed"],
 +
  "code": 405
 +
}
 +
</pre>

Latest revision as of 13:44, 17 July 2026

API » Get Custom Fields

Base URL

https://app.callproof.com

Endpoint

/api/custom_fields/get/

Purpose

Retrieves the custom field definitions configured for contacts in your CallProof company. Use this to understand which custom fields are available for contacts, including field names, field types, display order, default options, and selectable option values.

HTTP Method

GET

Headers

No required headers.

Header Required Description
No headers are required for this endpoint. Authentication is provided via query parameters.

Security

  • Yes – Requires a valid API key and secret with permission to read custom fields.

Parameters

Path Parameters

None.

Query Parameters

Parameter Type Required Description
key string Yes Public API key assigned to your CallProof account.
secret string Yes Private API secret paired with the API key.

Request Body

None.

cURL Example

curl -X GET "https://app.callproof.com/api/custom_fields/get/?key=YOUR_API_KEY&secret=YOUR_API_SECRET"

Successful Response (200)

Returns the contact custom fields configured for your company, ordered by their display position.

Field Type Description
results array List of contact custom field definitions.
results[].id integer Unique identifier for the custom field.
results[].name string Custom field display name.
results[].cfield_table string Business area where the custom field is used. For this endpoint, this is contact-related.
results[].cfield_type string Type of custom field, such as text, date, select, or another configured type.
results[].cfield_option_default string Default option name for fields that support default options. Empty when no default is configured.
results[].rfield string Related regular field name, when applicable.
results[].cfield string Parent or linked custom field name, when applicable.
results[].position integer Display order position.
results[].points integer Points value assigned to the field.
results[].hide_on_checkout string 1 if hidden during checkout; otherwise 0.
results[].options array Selectable options configured for the custom field.
results[].options[].id integer Unique identifier for the option.
results[].options[].name string Option display name.
results[].options[].cfield_id integer Identifier of the custom field that owns the option.
results[].options[].cfield string Name of the custom field that owns the option.
results[].options[].is_default string 1 if this option is a default option; otherwise 0.
results[].options[].position integer Option display order position.
results[].options[].points integer Points value assigned to the option.
errors array Empty list when the request succeeds.
code integer HTTP-style status value; 200 on success.

Example response:

{
  "results": [
    {
      "id": 12,
      "name": "Industry",
      "cfield_table": "contact",
      "cfield_type": "select",
      "cfield_option_default": "Manufacturing",
      "rfield": "",
      "cfield": "",
      "position": 1,
      "points": 0,
      "hide_on_checkout": "0",
      "options": [
        {
          "id": 101,
          "name": "Manufacturing",
          "cfield_id": 12,
          "cfield": "Industry",
          "is_default": "1",
          "position": 1,
          "points": 0
        }
      ]
    }
  ],
  "errors": [],
  "code": 200
}

Notes

  • This endpoint returns contact custom field definitions, not custom field values for a specific contact.
  • Results are ordered by custom field position.
  • Only custom fields belonging to your company are returned.
  • Option lists are included for fields that have selectable options.
  • If no contact custom fields are configured, the response returns an empty results list with status 200.
  • Use /api/contact/custom_fields/update/ to update custom field values for a specific contact.

Error Responses

Status Code Meaning
401 Unauthorized – The API key and/or secret is missing, invalid, inactive, associated with a disabled account, or lacks permission to read custom fields.
405 Method Not Allowed – A method other than GET was used.
500 Internal Server Error – An unexpected server problem occurred. Not specified in Swagger.

401 response body example:

{
  "results": [],
  "errors": ["Invalid API Key"],
  "code": 401
}

405 response body example:

{
  "results": [],
  "errors": ["Method not allowed"],
  "code": 405
}