Difference between revisions of "Nearest Places Add to CallProof Contacts"
Ashley DeBon (talk | contribs) (→Add Place Contact) |
Ashley DeBon (talk | contribs) (→Successful Response (200)) |
||
| Line 43: | Line 43: | ||
| longitude || string/number || Yes || Place longitude | | longitude || string/number || Yes || Place longitude | ||
|} | |} | ||
| + | |||
| + | === cURL Example for Android === | ||
| + | |||
| + | <pre> curl --location 'https://apimobile.callproof.com/api/place-contact' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "place_id": ["YOUR_PLACE_ID"], "name": "YOUR_PLACE_NAME", "latitude": "YOUR_LATITUDE", "longitude": "YOUR_LONGITUDE" }' </pre> | ||
| + | |||
| + | === cURL Example for iOS === | ||
| + | |||
| + | <pre> curl --location 'https://apimobile.callproof.com/api/place-contact' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "place_id": ["YOUR_PLACE_ID"], "name": "YOUR_PLACE_NAME", "latitude": "YOUR_LATITUDE", "longitude": "YOUR_LONGITUDE" }' </pre> | ||
=== Successful Response (200) === | === Successful Response (200) === | ||
Latest revision as of 14:18, 20 July 2026
Contents
Mobile_API »Add Place Contact
Base URL
https://apimobile.callproof.com
Endpoint
/api/place-contact
Purpose
Creates CallProof contact(s) from Google Places / Places search results. Accepts one or more place IDs. For a single place, returns the created (or existing) contact ID. For multiple places (lasso selection), returns a result list for each place indicating whether it was newly created or already existed.
HTTP Method
POST
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | Bearer access token |
Security
- Yes – Requires Bearer Token authentication.
Parameters
Path Parameters
None.
Query Parameters
None.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| place_id | string (JSON array) | Yes | JSON array of place ID(s) to convert into contacts (for example, ["ChIJ..."] or multiple IDs for lasso)
|
| name | string | Yes | Place/display name |
| latitude | string/number | Yes | Place latitude |
| longitude | string/number | Yes | Place longitude |
cURL Example for Android
curl --location 'https://apimobile.callproof.com/api/place-contact' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "place_id": ["YOUR_PLACE_ID"], "name": "YOUR_PLACE_NAME", "latitude": "YOUR_LATITUDE", "longitude": "YOUR_LONGITUDE" }'
cURL Example for iOS
curl --location 'https://apimobile.callproof.com/api/place-contact' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "place_id": ["YOUR_PLACE_ID"], "name": "YOUR_PLACE_NAME", "latitude": "YOUR_LATITUDE", "longitude": "YOUR_LONGITUDE" }'
Successful Response (200)
Single place
Used when one place ID is submitted.
| 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, "New accounts added." or "Account added successfully" when the place already exists as a contact) |
| contact_id | integer | Identifier of the created or existing contact |
| uri | string | Requested resource URI |
Multiple places (lasso)
Used when more than one place ID is submitted.
| 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, "New accounts added.") |
| data | array | Per-place results (see below) |
| uri | string | Requested resource URI |
data[] (lasso)
| Field | Type | Description |
|---|---|---|
| place_id | string | Place identifier that was processed |
| contact_id | integer | Contact identifier created or already linked to the place |
| is_exists | boolean | true if the place was already a contact; false if newly created
|
Error Responses
| Status Code | Meaning |
|---|---|
| 200 | Validation failed – response body uses clientStatusCode 401 with the first validation error message
|
| 400 | Bad Request – place contact(s) could not be created |
| 401 | Unauthorized – missing, invalid, or expired Bearer token |
- Validation (HTTP 200, clientStatusCode 401) – Missing
place_id,name,latitude, orlongitude. - 400 – Place data not found, or another create error (for example, "Error While Adding PlaceContact").
- 401 – Authentication failed or the access token is missing/expired.