Difference between revisions of "Update Custom fields option"

From docs
Jump to: navigation, search
(Created page with "== Update Contact Custom Fields == === Base URL === https://apimobile.callproof.com === Endpoint === /api/contact/{id}/custom-fields === Purpose === Updates custom field va...")
 
(Successful Response (200))
 
Line 64: Line 64:
 
| required || boolean || No || Whether the field is marked required (defaults to false when omitted)
 
| required || boolean || No || Whether the field is marked required (defaults to false when omitted)
 
|}
 
|}
 +
 +
=== cURL Example for Android ===
 +
<pre>
 +
curl --location --request PUT 'https://apimobile.callproof.com/api/contact/{id}/custom-fields' \
 +
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
 +
--form 'form_data=[{"custom_field_id":1,"custom_field_type_id":1,"value":"YOUR_VALUE"}]'
 +
</pre>
 +
=== cURL Example for iOS ===
 +
<pre>
 +
curl --location --request PUT 'https://apimobile.callproof.com/api/contact/{id}/custom-fields' \
 +
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
 +
--form 'form_data=[{"custom_field_id":1,"custom_field_type_id":1,"value":"YOUR_VALUE"}]'
 +
</pre>
  
 
=== Successful Response (200) ===
 
=== Successful Response (200) ===

Latest revision as of 13:06, 17 July 2026

Update Contact Custom Fields

Base URL

https://apimobile.callproof.com

Endpoint

/api/contact/{id}/custom-fields

Purpose

Updates custom field values for a specific contact. Accepts a JSON list of field values and saves each supported field type (text, select, radio, checkbox, textarea, date/time, number, image, and multi-select).

HTTP Method

PUT

Headers

Header Required Description
Authorization Yes Bearer access token
Content-Type Conditional Use multipart/form-data when uploading image custom-field files; otherwise form/JSON body is fine

Security

  • Yes – Requires Bearer Token authentication.

Parameters

Path Parameters

Parameter Type Required Description
id integer Yes Unique identifier of the contact whose custom fields are being updated

Query Parameters

None.

Request Body

Parameter Type Required Description
form_data string (JSON) Yes JSON array (or single object) of custom field values to update
form_field_file_{custom_field_id} file No Image file for an image-type custom field (file name includes the custom field ID)
contact_image file No Alternate image upload field used by some image custom-field flows

form_data object fields

Parameter Type Required Description
custom_field_id integer Yes Custom field identifier (alias: field_id)
custom_field_type_id integer Yes Field type identifier (alias: cfield_type_id). Supported values: 1 text, 2 select, 3 radio, 4 checkbox, 6 textarea, 7 date, 8 time, 9 datetime, 10 integer, 11 decimal, 12 auto-integer, 13 image, 14 multiple select
value string Conditional Field value for text, checkbox, textarea, date/time, number, image, and multiple-select fields
option_selected_id integer/string Conditional Selected option ID for select and radio fields
custom_field_option_default_id string No Optional default/selected option identifier
required boolean No Whether the field is marked required (defaults to false when omitted)

cURL Example for Android

curl --location --request PUT 'https://apimobile.callproof.com/api/contact/{id}/custom-fields' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--form 'form_data=[{"custom_field_id":1,"custom_field_type_id":1,"value":"YOUR_VALUE"}]'

cURL Example for iOS

curl --location --request PUT 'https://apimobile.callproof.com/api/contact/{id}/custom-fields' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--form 'form_data=[{"custom_field_id":1,"custom_field_type_id":1,"value":"YOUR_VALUE"}]'

Successful Response (200)

Indicates that the contact custom fields were updated successfully.

Field Type Description
clientStatusCode integer Status indicator for the client (for example, 200)
user_id integer Identifier of the authenticated user
company_id integer Identifier of the authenticated user’s company
message string Confirmation message (for example, "Custom fields updated Sucessfully")
uri string Requested resource URI

Error Responses

Status Code Meaning
200 Validation failed – response body uses clientStatusCode 401 with the first validation error message
400 Bad Request – custom fields could not be updated
401 Unauthorized – missing, invalid, or expired Bearer token
  • Validation (HTTP 200, clientStatusCode 401) – Missing form_data.
  • 400 – Invalid field value (for example, "Text Field is Required", "Select Field is Required"), or a general update failure (for example, "Something went wrong while updating custom fields" / "Error While Updating the custom fields").
  • 401 – Authentication failed or the access token is missing/expired.