Push the current browser geolocation for the authenticated user
const url = 'http://localhost:11044/api/v1/context/observation/location';const options = { method: 'POST', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>', 'Content-Type': 'application/json'}, body: '{"lat":1,"lng":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”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
A browser geolocation fix, as navigator.geolocation reports it, pushed for the signed-in user by POST /context/observation/location
object
Latitude in decimal degrees, -90 to 90; a value outside that range drops the push without recording it
Longitude in decimal degrees, -180 to 180; a value outside that range drops the push without recording it
Example generated
{ "lat": 1, "lng": 1}Responses
Section titled “Responses”No Content

