Forum Academy Marketplace Showcase Pricing Features

Google distancematrix and API Connector

Hi, I would like to call G’Api “DistanceMatrix”, and I set up it trough “API Connector” using this call

https://maps.googleapis.com/maps/api/distancematrix/json?origins=[origin]&destinations=[destination]&key=HIDDEN

It works. But I have problem with restriction. I followed the info in the manual of Bubble, but with “API Connector” I don’t understand how to set up Google restrictions. Indeed, it works only without restrictions.

“Distance Matrix API” is enabled “Server side”.
“Referrer HTTP” is enabled “Client Side” using https://myapp.bubbleapps.io/*

Any advice?

1 Like

You’d have to screenshot how you’ve set it up in the API connector and what restrictions you’d like to set up.

Here I am, with all the relevant screenshots…

Thanks



From the look of things, your Google API setup is okay. What error does Google return when you call the API from the API Connector?

I receive:
{
“destination_addresses”: [],
"error_message": “API keys with referer restrictions cannot be used with this API.”,
“origin_addresses”: [],
“rows”: [],
"status": "REQUEST_DENIED"
}