Backend endpoint with Google API geocode URL?

Hello,

it seems that geolocation (with google api) is not working well when it’s called with a backend workflow (as endpoint).

I’m having this error “Invalid data for key address: Error hitting Google Geocode” if I create an URL restriction on Google ( = app with the endpoint).
For information, my app already use Google API without any problem (finding an address, display map with pins …)

Do you know if the API calls from backend workflow to Google API are using a specific URL ? other that appname.bubbleapps.io/* or appname.com/* (I’m having my own domain name).

I’m also having this error if I pass the address as text field and try to convert it :
“statusCode”: 400,
“message”: “Error hitting Google Geocode API: API keys with referer restrictions cannot be used with this API.”,
“args”: {
“bubble_code”: “1669117194919x372277895749340000”
}

Thanks

Did you ever work this out? I’m also struggling with Bubble’s mapping functions in backend workflows. (In my case, sorting by distance seems to work fine client-side, but not in an API workflow.)

At least for OP it just sounds like the API key setup in Google Cloud has the referrer restriction enabled and Google doesn’t like that?

Not that the URL is incorrect but the error says they don’t allow that restriction on Google’s side

Hey @ts11. Apparently TIL why Bubble doesn’t let us do this with our keys. Old thread here: Setting up Google API Key's Restrictions

1 Like

Thank you for hopping in here, @keith. In this case, I don’t have any restrictions set on the geocoding API key, and I’m only encountering an issue when I try to sort by distance within an API workflow. Client-side, it seems to be working fine. I posted a more complete explanation of the issue at the post below. It’s got me puzzled.