Difference between revisions of "Create a New Contact Personnel"

From docs
Jump to: navigation, search
(Created page with "== Create Contact Personnel == === Base URL === https://apimobile.callproof.com === Endpoint === /api/contacts/{id}/contact-personnel === Purpose === Creates a new person a...")
 
(Successful Response (200))
 
Line 61: Line 61:
 
| business_card_id || integer || No || Business card identifier to associate when created from a business card
 
| business_card_id || integer || No || Business card identifier to associate when created from a business card
 
|}
 
|}
 +
 +
=== cURL Example for Android ===
 +
<pre>
 +
curl --location --request POST 'https://apimobile.callproof.com/api/contacts/{id}/contact-personnel' \
 +
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
 +
--form 'first_name=YOUR_FIRST_NAME'
 +
</pre>
 +
=== cURL Example for iOS ===
 +
<pre>
 +
curl --location --request POST 'https://apimobile.callproof.com/api/contacts/{id}/contact-personnel' \
 +
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
 +
--form 'first_name=YOUR_FIRST_NAME'
 +
</pre>
  
 
=== Successful Response (200) ===
 
=== Successful Response (200) ===

Latest revision as of 08:38, 17 July 2026

Create Contact Personnel

Base URL

https://apimobile.callproof.com

Endpoint

/api/contacts/{id}/contact-personnel

Purpose

Creates a new person associated with a specific contact. The request can include name, email, title, role, notes, phone numbers, and an optional image. The new person is linked to the contact so they appear in the contact’s personnel list.

HTTP Method

POST

Headers

Header Required Description
Authorization Yes Bearer access token

Security

  • Yes – Requires Bearer Token authentication.

Parameters

Path Parameters

Parameter Type Required Description
id integer Yes Unique identifier of the contact to which the person is added

Query Parameters

None.

Request Body

Parameter Type Required Description
first_name string Yes First name of the person
last_name string No Last name of the person
email string No Email address. Must be a valid email format when provided
title string No Job title (maximum 75 characters)
people_role_id integer No People role identifier for the person
phones string No JSON array of phone objects. Each object may include phone_number (maximum 15 characters) and extension (maximum 6 characters)
contact_notes string No Notes associated with the person
contact_image file No Profile image file for the person
form_data string No JSON custom field data; used when an image-type custom field should store the uploaded image reference
is_business_upload boolean No Indicates whether the person is being created from a business card upload
business_card_id integer No Business card identifier to associate when created from a business card

cURL Example for Android

curl --location --request POST 'https://apimobile.callproof.com/api/contacts/{id}/contact-personnel' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--form 'first_name=YOUR_FIRST_NAME'

cURL Example for iOS

curl --location --request POST 'https://apimobile.callproof.com/api/contacts/{id}/contact-personnel' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--form 'first_name=YOUR_FIRST_NAME'

Successful Response (200)

Indicates that the contact person was created 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, "Contact Personnel Added Successfully")
uri string Requested resource URI

Error Responses

Status Code Meaning
200 Validation failure – request body failed validation (returned with an error payload and clientStatusCode 401)
400 Bad Request – the contact person could not be created (for example, contact not found or processing error)
401 Unauthorized – missing, invalid, or expired Bearer token
  • 200 (validation failure) – Required fields are missing or invalid (for example, missing first name, invalid email, title too long, or invalid phones JSON / phone number or extension length).
  • 400 – The contact was not found, or another error occurred while creating the contact person (for example, "Error While Adding Contact Personnel").
  • 401 – Authentication failed or the access token is missing/expired.