Asset Tracking APIs
Use the following APIs to update and retrieve the geographic location of your devices
1. Update a device's geographic (GPS) location.
curl https://api.socketxp.com/v1/devices/location/:device_id \
-X POST \
-H "Authorization: Bearer <your-auth-token-goes-here>" \
-d '{"Lat": 37.813699649742475, "Lng": -122.47787639433689}'
Description:
If your device has a GPS integrated with it or if you could fetch the device's GPS co-ordinates(Longitude and Latitude) from your 4G/5G network provider or using Google's GeoLocation API, you can update the GPS co-ordinates of your device with SocketXP using the following API.
This API is useful if you want to view your device's geo location in the SocketXP portal's map view.
Note: The Latitude and Longitude values are float values and not string.
Sample Usage:
curl https://api.socketxp.com/v1/devices/location/1abc-abcde-acbdefgh-a1b3c3d4-abc \
-X POST \
-H "Authorization: Bearer <your-auth-token-goes-here>" \
-d '{"Lat": 37.813699649742475, "Lng": -122.47787639433689}'
Sample Response:
200 OK
2. GET a device's geographic (GPS) location:
curl https://api.socketxp.com/v1/devices/location \
-X GET \
-H "Authorization: Bearer <your-auth-token-goes-here>"
Description:
The API returns a list of all devices with its GPS co-ordinates currently stored in our cloud gateway's database.
Sample Usage:
curl https://api.socketxp.com/v1/devices/location \
-X GET \
-H "Authorization: Bearer <your-auth-token-goes-here>"