Difference between revisions of "Add New labels For Specific Contact"

From docs
Jump to: navigation, search
(Created page with "== Add Contact Label == === Base URL === https://apimobile.callproof.com === Endpoint === /api/contact/{id}/label === Purpose === Assigns a label to a contact. You can eith...")
 
(Successful Response (200))
 
Line 43: Line 43:
 
| label_id || integer/string || Conditional || Existing label ID to assign to the contact. Required when <code>label</code> is not provided
 
| label_id || integer/string || Conditional || Existing label ID to assign to the contact. Required when <code>label</code> is not provided
 
|}
 
|}
 +
 +
=== cURL Example for Android ===
 +
<pre>
 +
curl --location --request POST 'https://apimobile.callproof.com/api/contact/{id}/label' \
 +
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
 +
--form 'label=YOUR_LABEL_NAME'
 +
</pre>
 +
=== cURL Example for iOS ===
 +
<pre>
 +
curl --location --request POST 'https://apimobile.callproof.com/api/contact/{id}/label' \
 +
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
 +
--form 'label=YOUR_LABEL_NAME'
 +
</pre>
  
 
=== Successful Response (200) ===
 
=== Successful Response (200) ===

Latest revision as of 12:45, 17 July 2026

Add Contact Label

Base URL

https://apimobile.callproof.com

Endpoint

/api/contact/{id}/label

Purpose

Assigns a label to a contact. You can either create a new label by name, or attach an existing label by ID.

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

Query Parameters

None.

Request Body

Parameter Type Required Description
label string Conditional New label name to create and assign (maximum 100 characters). Required when label_id is not provided
label_id integer/string Conditional Existing label ID to assign to the contact. Required when label is not provided

cURL Example for Android

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

cURL Example for iOS

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

Successful Response (200)

Indicates that the label was assigned to the contact 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 label added successfully")
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 – the label could not be added
401 Unauthorized – missing, invalid, or expired Bearer token
  • Validation (HTTP 200, clientStatusCode 401) – Neither label nor label_id was provided, or label exceeds 100 characters.
  • 400 – Contact not found ("Contact Not Found"), label already exists on the account ("Label already exists on this Account"), or another add error (for example, "Error while Adding Contact Label").
  • 401 – Authentication failed or the access token is missing/expired.