Google Nearby Search API Connector Issue - Error 400

It’s a good job I’m already bald, because this has been stressing me out all day - hoping someone can help me please <3

I’m getting the following error trying to initialize a Nearby Search via Google’s API.

Here’s the way I’ve set up the call, directly copying the example code on Google’s API documentation (Nearby Search (New)  |  Places API  |  Google for Developers).

The only thing I’ve changed is adding in the key in as a header (the request was denied without it), and into the body of the API where specified by the documentation.

Clearly, I’m not a developer - please help me :melting_face:

P.S. If you’re wondering why I’m not just using the Google Place plug in, it’s because I need to return the closest single result to an address/long,lat. The standard plug in returns too many results in a random order. If there is a better way to do this than my current approach, please let me know!

1 Like

UPDATE: Removing

curl -X POST -d

from the start of the body changes the error to a parsing error :man_shrugging:

Not sure if I’m closer or further away with that change though?

You need to just keep the JSON, without surrounding single quotes. If you want to use the “curl,”, you need to use “Import another call from curl”…

Content-type: application/json should be added as header (this is what -H mean) same thing for X-Goog-FieldMask: places.displayName

1 Like

I have never felt like such a fool whilst simultaneously loving a stranger so much, thank you @Jici :blush:

1 Like