Difference between revisions of "Update Image For Specific Contact"
Ashley DeBon (talk | contribs) (Created page with "== Upload Contact Image == === Base URL === https://apimobile.callproof.com === Endpoint === /api/contact/{id}/image === Purpose === Uploads a new image for a specific cont...") |
Ashley DeBon (talk | contribs) (→Successful Response (200)) |
||
| Line 43: | Line 43: | ||
| contact_image || file || Yes || Image file to upload (must be a valid image; minimum size rule is <code>min:5</code>) | | contact_image || file || Yes || Image file to upload (must be a valid image; minimum size rule is <code>min:5</code>) | ||
|} | |} | ||
| + | |||
| + | === cURL Example for Android === | ||
| + | <pre> | ||
| + | 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' | ||
| + | </pre> | ||
| + | === cURL Example for iOS === | ||
| + | <pre> | ||
| + | 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' | ||
| + | </pre> | ||
=== Successful Response (200) === | === Successful Response (200) === | ||
Latest revision as of 11:58, 17 July 2026
Contents
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.