Update Image For Specific Contact

From docs
Jump to: navigation, search

Upload Contact Image

Base URL

https://apimobile.callproof.com

Endpoint

/api/contact/{id}/image

Purpose

Uploads a new image for a specific contact and stores it against that contact for the authenticated user’s company.

HTTP Method

POST

Headers

Header Required Description
Authorization Yes Bearer access token
Content-Type Yes multipart/form-data (file upload)

Security

  • Yes – Requires Bearer Token authentication.

Parameters

Path Parameters

Parameter Type Required Description
id integer Yes Unique identifier of the contact that will receive the image

Query Parameters

None.

Request Body

Parameter Type Required Description
contact_image file Yes Image file to upload (must be a valid image; minimum size rule is min:5)

cURL Example for Android

curl --location --request POST 'https://apimobile.callproof.com/api/contact/{id}/image' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--form 'contact_image=@/path/to/image.jpg'

cURL Example for iOS

curl --location --request POST 'https://apimobile.callproof.com/api/contact/{id}/image' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--form 'contact_image=@/path/to/image.jpg'

Successful Response (200)

Indicates that the contact image was uploaded 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 Image Uploaded 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 image could not be uploaded
401 Unauthorized – missing, invalid, or expired Bearer token
  • Validation (HTTP 200, clientStatusCode 401) – Missing contact_image, or the file is not a valid image / fails size validation.
  • 400 – Contact not found ("Contact Not Found"), storage/directory failure, or another upload error (for example, "Error While Uploading Contact Image").
  • 401 – Authentication failed or the access token is missing/expired.