Google Places API

42 views
Skip to first unread message

kevin....@gmail.com

unread,
Mar 7, 2014, 4:24:19 PM3/7/14
to codenameone...@googlegroups.com
Has anyone successfully created an app which adds places to the google maps/places data?  I can query the places database, I can use the geocoding APIs, I can get google maps, etc.  I have turned on the Places API.  For some reason I don't seem to be able to build a valid POST http request.  There is a nested structure in the request for the location, containing the lat and long. I've included what the request is supposed to look like.  I've tried a million different things and I keep getting Bad Request 400 errors.  Any ideas?
POST https://maps.googleapis.com/maps/api/place/add/json?sensor=true_or_false&key=AddYourOwnKeyHere HTTP/1.1
Host: maps.googleapis.com

{
 
"location": {
   
"lat": -33.8669710,
   
"lng": 151.1958750
 
},
 
"accuracy": 50,
 
"name": "Google Shoes!",
 
"types": ["shoe_store"],
 
"language": "en-AU"
}

Shai Almog

unread,
Mar 8, 2014, 3:46:38 AM3/8/14
to codenameone...@googlegroups.com, kevin....@gmail.com
Did you look at this?
https://github.com/segun/coma

If the request is a post request you must not add anything to the URL after json.
Use the addArgument method to add the sensor and key values.
Reply all
Reply to author
Forward
0 new messages