{
"destination_addresses" : [],
"error_message" : "This API project is not authorized to use this API.",
"origin_addresses" : [],
"rows" : [],
"status" : "REQUEST_DENIED"
}
项目启用了正确的API 事实帐户已得到验证并链接到项目我实际上遵循这些步骤来验证一切:
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.
可能发生这种错误,因为根据距距离矩阵API的开发人员文档:
该产品或功能处于遗产状态,无法启用新用法。