Fire Eagle : Updating a User's Location

Updating a User's Location

The one method to update a user's location is update. You can pass in a variety of location inputs to the update method. Additionally, use lookup method to make sure that you are sending in a non-ambiguous location to update.


update

Sets a user's current location using a WOEID or a set of location parameters. If the user provides a location unconfirmed with lookup method then Fire Eagle makes a best guess as to the user's location and updates.

Called with the user-specific access token.

https://fireeagle.yahooapis.com/api/0.1/update

Required Parameters:
  • oauth_consumer_key : application consumer key
  • oauth_token : the user-specific access token
  • one or more location parameters
  • oauth_nonce, oauth_timestamp, oauth_signature_method, oauth_version, oauth_signature
Optional Parameters:
  • label : Label for a location - like 'Home', 'Office' or 'John's house'

This method is called via HTTP POST. Returns success or failure validation response message. Success does not confirm that the user's location was updated correctly, it only acknowledges that the update request was received. Therefore, before you call the update, you should make sure that Fire Eagle properly understands how to parse the location that you're entering by using the lookup method.

Location parameter passed into Fire Eagle for updating a user's location can be from a variety of input methods. Fire Eagle will parse the location inputs in a specific order. For example, if you provide lat/lon and cell tower information, Fire Eagle will use the more precise latitude and longitude geo-coordinates and ignore the cell tower information.

Example: /update.xml

Request

https://fireeagle.yahooapis.com/api/0.1/update

POST Data

oauth_consumer_key=0000000000000&oauth_signature_method=HMAC-SHA1&oauth_version=1.0&oauth_token=mEhrJ6Zl8RHI&postal=94107&oauth_timestamp=1204592174&oauth_nonce=Jc0B3D&oauth_signature=w5JkljU3lk3MvAxlNnyPJcGuBAQ%3D

Response


<?xml version="1.0" encoding="UTF-8"?>
<rsp stat="ok">
  <user token="mEhrJ6Zl8RHI" located-at="2008-08-06T16:04:46-08:00"/>
</rsp>

Example: /update.json

Request

https://fireeagle.yahooapis.com/api/0.1/update.json

POST Data

oauth_consumer_key=0000000000000&oauth_signature_method=HMAC-SHA1&oauth_version=1.0&oauth_token=mEhrJ6Zl8RHI&postal=94107&oauth_timestamp=1204592547&oauth_nonce=66npAV&oauth_signature=yvFNpZVbmjdPVx5ENaGar4WcEFw%3D

Response


{"user":{
  "token":"mEhrJ6Zl8RHI",
  "located_at":"2008-08-06T16:04:46-08:00"},
 "stat":"ok"}

lookup

Disambiguates potential values for update. Results from lookup can be passed to update to ensure that Fire Eagle will understand how to parse the location parameter.

Called with the user-specific or general-purpose access token.

https://fireeagle.yahooapis.com/api/0.1/lookup

Required Parameters:
  • oauth_consumer_key : application consumer key
  • oauth_token : user-specific or general-purpose access token
  • one or more location parameters
  • oauth_nonce, oauth_timestamp, oauth_signature_method, oauth_version, oauth_signature

Location data passed into lookup take the same location parameters as update.

Returns a list of values that match the location parameters suitable for passing to update. If a lat/lon pair is provided, it will be returned directly, as it is not ambiguous. A street address that maps exactly will return the street address; any associated Place ID returned will be less precise. A less precise address will return 1 or more Place IDs with accompanying human readable names.

Use this method to ask Fire Eagle to disambiguate location names your users have entered: e.g. user enters Pensacola, use lookup to see that Pensacola could be Pensacola, FL or Pensacola, NC or Pensacola, OK.

Example: /lookup.xml

Request

https://fireeagle.yahooapis.com/api/0.1/lookup.xml?oauth_consumer_key=0000000000000&oauth_signature_method=HMAC-SHA1&oauth_version=1.0&oauth_token=UZuTj74EUF70&address=Pensacola&oauth_timestamp=1204590774&oauth_nonce=voOR9B&oauth_signature=m66dL4XQ4PzhX4CkXaGiOE76lig%3D

Response


<rsp stat="ok">
  <query>address=Pensacola</query>
  <locations start="0" total="3" count="3">
    <location>
      <name>Pensacola, FL</name>
      <place-id>qQ7Vig2bBZsZCy82</place-id>
      <woeid>2470377</woeid>
    </location>
    <location>
      <name>Pensacola, NC</name>
      <place-id>4.CTkJibBZv.G1c2</place-id>
      <woeid>2470405</woeid>
    </location>
    <location>
      <name>Pensacola, OK</name>
      <place-id>bRDKoQibBZtXopXZ</place-id>
      <woeid>2470375</woeid>
    </location>
  </locations>
</rsp>

Example: /lookup.json

Request

https://fireeagle.yahooapis.com/api/0.1/lookup.json?oauth_consumer_key=0000000000000&oauth_signature_method=HMAC-SHA1&oauth_version=1.0&oauth_token=UZuTj74EUF70&address=pensacola&oauth_timestamp=1204590967&oauth_nonce=1P4XX8&oauth_signature=EaSlsI1qN5Q00EtpHTXHkLcWM0o%3D

Response


{"start":0,
 "stat":"ok",
 "locations":[{"name":"Pensacola, FL",
               "place_id":"qQ7Vig2bBZsZCy82",
               "woeid":2470377},
              {"name":"Pensacola, NC",
               "place_id":"4.CTkJibBZv.G1c2",
               "woeid":2470405},
              {"name":"Pensacola, OK",
               "place_id":"bRDKoQibBZtXopXZ",
               "woeid":2470375}],
 "count":3,
 "total":3,
 "query":"address=Pensacola"}