I'm trying to use the Google Matrix Api on a web project using a token to authenticate. The testing is done in console to minimize potential errors like bellow :
curl "https://maps.googleapis.com/maps/api/distancematrix/json?origins=Paris&destinations=Lyon&key=___MYAPIKEY___"
This is the response I always have :
{
"destination_addresses" : [],
"error_message" : "This API project is not authorized to use this API.",
"origin_addresses" : [],
"rows" : [],
"status" : "REQUEST_DENIED"
}
The right API is enabled on the project The facturation account has been validated and linked to the project
I actually followed those steps to verify everything :
1. Check the activation of the Distance Matrix API Go to the Google Cloud Console: Google Cloud Console Select your project at the top of the page. Navigate to API & Services > Library. Search for Distance Matrix API and ensure that it is activated for your project. 2. Check the API key Go to API & Services > Credentials. Locate the API key you are using in your request. Make sure you are using the correct API key in your curl request. 3. Check API key restrictions I disabled all restriction in order to minimize errors 4. Check billing Go to Billing in the Google Cloud Console. Ensure that a billing account is linked to your project. Some APIs require an active billing account even for free requests.