Browse Source

include "geocode" property in response if it timed out

pull/5/head
Aaron Parecki 8 years ago
parent
commit
95110bf5dc
2 changed files with 3 additions and 1 deletions
  1. +1
    -1
      README.md
  2. +2
    -0
      compass/app/Http/Controllers/Api.php

+ 1
- 1
README.md View File

@ -40,7 +40,7 @@ To read a database, make a GET request as follows:
`GET /api/last`
* token - (required) the read token for the database
* tz - (optional, default UTC) timezone string (e.g. America/Los_Angeles) which will be used to determine the absolute start/end times for the day
* date - (optional, default to now) specify a full timestamp to return a single record before this date (the point returned will be no more than 24 hours before the given date)
* before - (optional, default to now) specify a full timestamp to return a single record before this date (the point returned will be no more than 24 hours before the given date)
* geocode - (optional) if "true", then the location found will be reverse geocoded using [Atlas](https://atlas.p3k.io) to find the city and timezone at the location

+ 2
- 0
compass/app/Http/Controllers/Api.php View File

@ -189,6 +189,8 @@ class Api extends BaseController
$geocode = json_decode(curl_exec($ch));
if($geocode) {
$response['geocode'] = $geocode;
} else {
$response['geocode'] = null;
}
}

Loading…
Cancel
Save