Geocoding & address based search
You can now create a geotrigger rule by providing an address instead of a latitude/longitude.
For example, instead of a coordinate (45.5233, -122.6816), you can just provide "Powell's Books, Portland, Oregon".
Example with cURL:
$ curl -H "Authorization: OAuth YOUR_APPLICATION\_ACCESS\_TOKEN" \
https://api.geoloqi.com/1/trigger/create \
-d "place_name=Powells Books" \
-d "key=powells_books" \
-d "type=message" \
-d "geocode=Powell%27s+Books%2C+Portland%2C+OR" \
-d "radius=300" \
-d "text=Welcome+to+Powell%27s+Books%21"
Example with Ruby:
require "geoloqi"
geoloqi_session = Geoloqi::Session.new(:access_token => "YOUR APPLICATION ACCESS TOKEN")
geoloqi_session.post("trigger/create", {
:place_name => "Powell's Books",
:key => "powells_books",
:type => "message",
:geocode => "Powell's Books, Portland, Oregon",
:radius => 150,
:text => "Welcome to Powell's Books!"
})
The geocoding parameter applies to these API methods:
Reverse geocoding
The Geoloqi API now enriches place information with the city, state and country of the coordinates. For example, if someone enters a geotrigger anywhere in the world, the Geoloqi API now sends the city name in the request instead of just the coordinates. This is accessible via the location/context
call.
Example with cURL:
curl -H "Authorization: OAuth 5985-5cf3cb83ab11c9793c683a9c37bbeb3d59003a22" \
"https://api.geoloqi.com/1/location/context?latitude=37.7793&longitude=-122.4192"
Returns the following JSON:
{
"locality_name" : "San Francisco",
"region_name" : "CA",
"postal_code" : "94102",
"full_name" : "San Francisco, CA",
"best_name" : "San Francisco"
}