最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Google Matrix API not authorized on this project with Token access key - Stack Overflow

programmeradmin2浏览0评论

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 ";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.

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/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.
Share Improve this question edited Mar 7 at 11:45 VLAZ 29.2k9 gold badges63 silver badges84 bronze badges asked Mar 7 at 6:32 GauthierGauthier 1,2762 gold badges18 silver badges39 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

This error is probably occurring because, according to the developer docs for the Distance Matrix API:

This product or feature is in Legacy status and cannot be enabled for new usage.

It’s been replaced by the Routes API

发布评论

评论列表(0)

  1. 暂无评论