0
Answered
API node, response object into variable
Hi,
I'm using the API node for requesting data from Google Maps API.
But at the Step2[3], the node can't store the response object into variable :
I tested the JSON paths with the website : http://jsonpath.com/
I pasted the JSON array into it and tested the JSON path, it's OK ('0' => "my value").
I thought maybe the node can't read the API response but the status is 200 OK, so it could be OK...
Do you have any ideas to help me? :)
Thanks!
Customer support service by UserEcho
Hi Vincent. Thanks for your note!
The API reply coming for your request is:
For this particular request, i.e Google maps API, you'll need to provide an API key to use their API. You'll need to consult the Google API documentation as to where exactly to find this API key.
As for the 200 OK coming back as a response, it's due to how Google's API has implemented this particular error scenario. Ideally, Google should not have returned a 200 for an error result.
Hi Michael,
I can see the JSON result.
Indeed, in "Open full Response", I can see :
Maybe the problem comes as you said from the "?" character in the request parameter...
Hi Vincent,
I checked your api node. There seems to be following error:
1. '?' in the starting. We automatically add the '?' in the request we send so no need for it to added by you.
2. The requests parameter are separated by & which for you are location=-33.8670522,151.1957362&rankby=distance&types=food&key=YOUR_API_KEY
3. Each request parameter should be entered as a key value pair in the api node. i.e key = value pair. For your case here is the example:
Note: In the tool when you enter a parameter and hit "enter/return" on keyboard a new row comes where you can enter additional parameters.
I have gone ahead and corrected the api requested for you in your tree. It seems to work. Hope this helps.
Let us know in case of any further help.
Regards,
Mitesh
Hi Mitesh, you are awesome :)
Everything works like a charm ;)
Many thanks !