Jeff Bryant
Jeff Bryant

Reputation: 133

Google Distance API Invalid Key

I'm just starting to use Google Maps APIs and I'm having some trouble when attempting to send a request via Postman to

[https://maps.googleapis.com/maps/api/distancematrix?<params>&key="key value"]

I've created an API Key in the Google Maps Console and I'm sending the key along with origins and destinations values however each time I attempt to send the request I'm receiving:

{
"destination_addresses": [],
"error_message": "The provided API key is invalid. ",
"origin_addresses": [],
"rows": [],
"status": "REQUEST_DENIED"

}

Now the odd thing is that I can call the Distance API using just fine. The results I receive from a call to:

https://maps.googleapis.com/maps/api/directions/json?<params>&key="key value"

returns a valid response.

I've checked and double checked the API key value and I'm sure it's being sent and it's the only key that I have generated.
Anyone have an idea what I'm missing?

Upvotes: 0

Views: 158

Answers (1)

Jeff Bryant
Jeff Bryant

Reputation: 133

After contacting google we determined that the problem is not with the request but with the JSON exported from the google maps api/Postman collection.
Changing the Authorization to none and manually adding the key as a parameter in a request corrected the issue.

Upvotes: 0

Related Questions