Skip to content

Push the current browser geolocation for the authenticated user

POST
/api/v1/context/observation/location
curl --request POST \
--url http://localhost:11044/api/v1/context/observation/location \
--header 'Content-Type: application/json' \
--header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \
--data '{ "lat": 1, "lng": 1 }'

Always returns 204. An unauthenticated push or out-of-range coordinates are silently dropped rather than recorded, so 204 does not guarantee the observation was stored.

lat and lng (both required): the browser’s position in decimal degrees, as navigator.geolocation reports it. Recorded as the user’s browser-geolocation observation at confidence 0.9, replacing the previous one from that source. A latitude outside -90..90 or a longitude outside -180..180 is dropped and still answers 204

Media typeapplication/json

A browser geolocation fix, as navigator.geolocation reports it, pushed for the signed-in user by POST /context/observation/location

object
lat
required

Latitude in decimal degrees, -90 to 90; a value outside that range drops the push without recording it

number format: double
lng
required

Longitude in decimal degrees, -180 to 180; a value outside that range drops the push without recording it

number format: double

Example generated

{
"lat": 1,
"lng": 1
}

No Content