Difference between revisions of "Save User Location Details"
Ashley DeBon (talk | contribs) (Created page with "== Store Contact Location Log == === Base URL === https://apimobile.callproof.com === Endpoint === /api/contact/location-log === Purpose === Saves the authenticated user’...") |
Ashley DeBon (talk | contribs) (→Successful Response (200)) |
||
| Line 43: | Line 43: | ||
| link_id || integer || No || Related record identifier to associate with the location log, when applicable | | link_id || integer || No || Related record identifier to associate with the location log, when applicable | ||
|} | |} | ||
| + | |||
| + | === cURL Example for Android === | ||
| + | <pre> | ||
| + | curl --location --request POST 'https://apimobile.callproof.com/api/contact/location-log' \ | ||
| + | --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ | ||
| + | --form 'latitude=YOUR_LATITUDE' \ | ||
| + | --form 'longitude=YOUR_LONGITUDE' \ | ||
| + | --form 'geo_track_type=YOUR_GEO_TRACK_TYPE' | ||
| + | </pre> | ||
| + | === cURL Example for iOS === | ||
| + | <pre> | ||
| + | curl --location --request POST 'https://apimobile.callproof.com/api/contact/location-log' \ | ||
| + | --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ | ||
| + | --form 'latitude=YOUR_LATITUDE' \ | ||
| + | --form 'longitude=YOUR_LONGITUDE' \ | ||
| + | --form 'geo_track_type=YOUR_GEO_TRACK_TYPE' | ||
| + | </pre> | ||
=== Successful Response (200) === | === Successful Response (200) === | ||
Latest revision as of 07:46, 17 July 2026
Contents
Store Contact Location Log
Base URL
https://apimobile.callproof.com
Endpoint
/api/contact/location-log
Purpose
Saves the authenticated user’s current geographic location. The latitude and longitude are stored as a location log entry and enriched with reverse-geocoded address details when available, so the system can track where the user was at the time of the log.
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 |
|---|---|---|---|
| latitude | string | Yes | Latitude of the user’s current location |
| longitude | string | Yes | Longitude of the user’s current location |
| geo_track_type | string | Yes | Location tracking type associated with the log entry |
| link_id | integer | No | Related record identifier to associate with the location log, when applicable |
cURL Example for Android
curl --location --request POST 'https://apimobile.callproof.com/api/contact/location-log' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --form 'latitude=YOUR_LATITUDE' \ --form 'longitude=YOUR_LONGITUDE' \ --form 'geo_track_type=YOUR_GEO_TRACK_TYPE'
cURL Example for iOS
curl --location --request POST 'https://apimobile.callproof.com/api/contact/location-log' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --form 'latitude=YOUR_LATITUDE' \ --form 'longitude=YOUR_LONGITUDE' \ --form 'geo_track_type=YOUR_GEO_TRACK_TYPE'
Successful Response (200)
Indicates that the location log was stored 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, "Success") |
| uri | string | Requested resource URI |
Error Responses
| Status Code | Meaning |
|---|---|
| 400 | Bad Request – the location log could not be stored successfully |
| 401 | Unauthorized – missing, invalid, or expired Bearer token |
- 400 – An error occurred while saving the location log or resolving address details for the coordinates.
- 401 – Authentication failed or the access token is missing/expired.