Difference between revisions of "Create Business Card Details"
Ashley DeBon (talk | contribs) (Created page with "== Add Business Card == === Base URL === https://apimobile.callproof.com === Endpoint === /api/add-business-card === Purpose === Creates a new business card for the authent...") |
Ashley DeBon (talk | contribs) (→Successful Response (200)) |
||
| Line 59: | Line 59: | ||
| notes || string || No || Free-text notes | | notes || string || No || Free-text notes | ||
|} | |} | ||
| + | |||
| + | === cURL Example for Android === | ||
| + | <pre> | ||
| + | curl --location --request POST 'https://apimobile.callproof.com/api/add-business-card' \ | ||
| + | --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ | ||
| + | --form 'business_card_image=@/path/to/front.jpg' | ||
| + | </pre> | ||
| + | === cURL Example for iOS === | ||
| + | <pre> | ||
| + | curl --location --request POST 'https://apimobile.callproof.com/api/add-business-card' \ | ||
| + | --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ | ||
| + | --form 'business_card_image=@/path/to/front.jpg' | ||
| + | </pre> | ||
=== Successful Response (200) === | === Successful Response (200) === | ||
Revision as of 13:36, 17 July 2026
Contents
Add Business Card
Base URL
https://apimobile.callproof.com
Endpoint
/api/add-business-card
Purpose
Creates a new business card for the authenticated user. Requires a front image; an optional back image and card contact details can also be provided. Email must be unique among that user’s existing business cards when supplied.
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
None.
Query Parameters
None.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| business_card_image | file | Yes | Front image of the business card (jpeg/png/jpg; minimum size rule min:5)
|
| business_card_back_image | file | No | Back image of the business card (jpeg/png/jpg when provided) |
| first_name | string | No | First name on the card |
| last_name | string | No | Last name on the card |
| title | string | No | Job title on the card |
| company_name | string | No | Company name on the card |
| address | string | No | Address (maximum 255 characters) |
| website | string | No | Website URL |
| string | No | Email address (must be a valid email format; must not already exist on another card for the same user) | |
| phone_number | string | No | Phone number (digits only; 7–15 characters when provided) |
| notes | string | No | Free-text notes |
cURL Example for Android
curl --location --request POST 'https://apimobile.callproof.com/api/add-business-card' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --form 'business_card_image=@/path/to/front.jpg'
cURL Example for iOS
curl --location --request POST 'https://apimobile.callproof.com/api/add-business-card' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --form 'business_card_image=@/path/to/front.jpg'
Successful Response (200)
Indicates that the business card 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 | object | Creation result payload (see below) |
| uri | string | Requested resource URI |
message
| Field | Type | Description |
|---|---|---|
| status | boolean | true when the card was created successfully
|
| message | string | Confirmation message (for example, "The Business card details added successfully.") |
| business_card_id | integer | Unique identifier of the newly created business card |
Error Responses
| Status Code | Meaning |
|---|---|
| 200 | Validation failed – response body uses clientStatusCode 401 with the first validation error message
|
| 400 | Bad Request – the business card could not be created |
| 401 | Unauthorized – missing, invalid, or expired Bearer token |
- Validation (HTTP 200, clientStatusCode 401) – Missing/invalid front image, invalid back image, invalid email, invalid phone number, or address longer than 255 characters.
- 400 – Email already exists ("Email already exists"), image not uploaded ("Image not uploaded"), or another create error (for example, "Error while adding the business card details").
- 401 – Authentication failed or the access token is missing/expired.