Difference between revisions of "Save Search Results"
Ashley DeBon (talk | contribs) (→Save Places Search) |
Ashley DeBon (talk | contribs) (→Successful Response (200)) |
||
| Line 65: | Line 65: | ||
| annual_sales || string (JSON object) || Conditional || Annual-sales filter object with <code>min_value</code>, <code>max_value</code>, and <code>selected</code> | | annual_sales || string (JSON object) || Conditional || Annual-sales filter object with <code>min_value</code>, <code>max_value</code>, and <code>selected</code> | ||
|} | |} | ||
| + | |||
| + | === cURL Example for Android === | ||
| + | |||
| + | <pre> curl --location 'https://apimobile.callproof.com/api/places-save' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "name": "YOUR_SEARCH_NAME", "latitude": "YOUR_LATITUDE", "longitude": "YOUR_LONGITUDE", "keyword": "", "address": "", "zip_code": "", "category_id": "", "radius": "", "results_count": "", "employee_count": "", "annual_sales": "" }' </pre> | ||
| + | |||
| + | === cURL Example for iOS === | ||
| + | |||
| + | <pre> curl --location 'https://apimobile.callproof.com/api/places-save' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "name": "YOUR_SEARCH_NAME", "latitude": "YOUR_LATITUDE", "longitude": "YOUR_LONGITUDE", "keyword": "", "address": "", "zip_code": "", "category_id": "", "radius": "", "results_count": "", "employee_count": "", "annual_sales": "" }' </pre> | ||
=== Successful Response (200) === | === Successful Response (200) === | ||
Latest revision as of 14:07, 20 July 2026
Contents
Mobile_API »Save Places Search
Base URL
https://apimobile.callproof.com
Endpoint
/api/places-save
Purpose
Saves the current Places search criteria under a name for the authenticated user and company. Stored filters depend on the company’s primary location search type (Google Places–style vs POI database–style).
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
Common fields for both search types:
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Name to save this search under |
| latitude | string/number | No | Search center latitude |
| longitude | string/number | No | Search center longitude |
| keyword | string | No | Search keyword/query |
| address | string | No | Address filter |
| zip_code | string | No | ZIP/postal code filter |
| category_id | string | No | Category filter (single ID for Google Places–style search; JSON array of IDs for POI search) |
Additional fields used for POI database–style companies:
| Parameter | Type | Required | Description |
|---|---|---|---|
| radius | string/number | No | Search radius |
| results_count | string/number | No | Maximum number of results |
| employee_count | string (JSON object) | Conditional | Employee-size filter object with min_value, max_value, and selected
|
| annual_sales | string (JSON object) | Conditional | Annual-sales filter object with min_value, max_value, and selected
|
cURL Example for Android
curl --location 'https://apimobile.callproof.com/api/places-save' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "name": "YOUR_SEARCH_NAME", "latitude": "YOUR_LATITUDE", "longitude": "YOUR_LONGITUDE", "keyword": "", "address": "", "zip_code": "", "category_id": "", "radius": "", "results_count": "", "employee_count": "", "annual_sales": "" }'
cURL Example for iOS
curl --location 'https://apimobile.callproof.com/api/places-save' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "name": "YOUR_SEARCH_NAME", "latitude": "YOUR_LATITUDE", "longitude": "YOUR_LONGITUDE", "keyword": "", "address": "", "zip_code": "", "category_id": "", "radius": "", "results_count": "", "employee_count": "", "annual_sales": "" }'
Successful Response (200)
Indicates that the Places search was saved 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, "Search Results Saved Successfully.") |
| uri | string | Requested resource URI |
Error Responses
| Status Code | Meaning |
|---|---|
| 400 | Bad Request – the search could not be saved |
| 401 | Unauthorized – missing, invalid, or expired Bearer token |
- 400 – An error occurred while saving the Places search (for example, invalid filter JSON or a processing failure).
- 401 – Authentication failed or the access token is missing/expired.