Google Cloud KMS error - This API is not acessible from your region. (HTTP status - 403) - google-cloud-kms

I have created a google cloud project and enabled Google Cloud Key Management Service (KMS) API. I have created two keyrings. keyring1 is located in us-east1 and keyring2 is located in global. I have created the following java program to list the keyrings in the region:
GoogleCredential credential = GoogleCredential.getApplicationDefault();
credential = credential.createScoped(CloudKMSScopes.all());
String keyRingPath = "projects/<<projectId>>/locations/global";
CloudKMS kms = new CloudKMS.Builder(httpTransport, jsonFactory, credential).setApplicationName("CloudKMS snippets").build();
ListKeyRingsResponse response = kms.projects().locations().keyRings().list(keyRingPath).execute();
System.out.println(response.getKeyRings());
I am getting following forbidden error:
Exception in thread "main" com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
"code" : 403,
"errors" : [ {
"domain" : "global",
"message" : "This API is not acessible from your region.",
"reason" : "forbidden"
} ],
"message" : "This API is not acessible from your region.",
"status" : "PERMISSION_DENIED"
}

I'm an engineer working on Cloud KMS.
Unfortunately, there are many complexities in making this service available in individual countries and we don't have a specific timeline as to when or if any particular country will be rolled out.
Anyone who is interested in the availability of a particular country should contact us to see if any information is available and to help us prioritize.

I am trying to invoke the Cloud KMS APIs from India. Looks like Cloud KMS is not yet available in all the locations. Cloud KMS service is not yet available in India. Click here to know the list of countries where Cloud KMS is available. That is why I was getting the This API is not acessible from your region. error

Related

Distance matrix API returns error message

I have been given project editor role for GCP project, I can see in https://console.cloud.google.com/billing/projects that the project has been mapped to a billing account, thus it shows billing account ID.
I tried test launch of a GCP instance to see if it is working. Distance matrix API has been enabled, an API key has been generated and tested distance matrix API however I am getting the following error message.
{
"destination_addresses": [],
"error_message": "You must enable Billing on the Google Cloud Project at https://console.cloud.google.com/project/_/billing/enable Learn more at https://developers.google.com/maps/gmp-get-started",
"origin_addresses": [],
"rows": [],
"status": "REQUEST_DENIED"
}
Why is this error ? If Billing is not enabled I couldn't have launched a VM instance.
Thank you ! The issue has resolved by creating a new billing account for Google maps by selecting Google Maps Platform instead of Google Cloud Platform at the time of creating Billing Account and then linking that Billing account with the newly created project. API Key generated with that new project works. Working with Google Maps needs creation of separate Billing account unlike regular Google Cloud Platform Billing Account

How to use google directions api for free

I was using Google Directions Api within the limit of 2500 route queries per day which is free. It was working fine. Now out of nowhere it gives this error while requesting the api when it is clearly written in https://developers.google.com/maps/documentation/directions/start
that Client Id is for premium plan.
Downloaded URL: { "error_message" : "You must enable Billing on the Google Cloud Projectassociated to this client ID, at https://console.cloud.google.com/project/_/billing/enable.Learn more at https://developers.google.com/maps/premium/new-plan-migration", "routes" : [], "status" : "REQUEST_DENIED"}
Background task data { "error_message" : "You must enable Billing on the Google Cloud Projectassociated to this client ID, at https://console.cloud.google.com/project/_/billing/enable.Learn more at https://developers.google.com/maps/premium/new-plan-migration", "routes" : [], "status" : "REQUEST_DENIED"}
How can I solve this issue
From the google maps documentation:
Reminder: To use the Directions API, you must include an API key with all API requests and you must enable billing on each of your projects.
I know they used to allow using the API without a key or billing enabled but they changed their policy a while back.
If you are willing to use an alternative to google maps you can look into OSRM (Open Source Routing Machine), this is completely free but requires some setup and you have to host it yourself. We use OSRM for directions and get much better performance hosting it ourselves for a fraction of the cost of googlemaps.

Enumerate files in gogle team drive where admin is not part of

I would like to know if a Google drive domain admin can enumerate files in team drive where he is not a member? currently this seems not supported through drive rest api, I'm using below API call to enumerate files and the corresponding error response below. Please let me know if there is any alternative api call to achieve this.
https://www.googleapis.com/drive/v2/files?teamDriveId=&corpora=teamDrive&fields=*&includeTeamDriveItems=true&supportsTeamDrives=true
{
"error": {
"errors": [
{
"domain": "global",
"reason": "teamDriveMembershipRequired",
"message": "The attempted action requires Team Drive membership."
}
],
"code": 403,
"message": "The attempted action requires Team Drive membership."
}
}
You must take note of the following Team Drives: Requirements & access levels before making any requests to Drive API.
Users with G Suite Basic cannot create or access Team Drives
unless they are invited by a member of an external organization that
has Team Drives.
Refer to the table below on what action you can do in every team drives if you are a member.
To learn more about Drive API methods, you can refer to the Drive API documentation.

How do I enable Google Maps Tile API?

I found out from here that there is a Google Maps Tile API (official documentation here).
However, I can't seem to find a way to enable this API.
Except for the link found in the question mentioned above, I couldn't find any other reference to this API, anywhere. It's not even listed on the main page of the Maps API (here) or the documentation page.
The API is also not listed in the Developer Console API Library.
I've tried sending a session request (as explained in the documentation) but received this response:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. Maps Tile API has not been used in project XXXXXXXXXXXX before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/tile.googleapis.com/overview?project=XXXXXXXXXXXX then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"extendedHelp": "https://console.developers.google.com/apis/api/tile.googleapis.com/overview?project=XXXXXXXXXXXX"
}
],
"code": 403,
"message": "Access Not Configured. Maps Tile API has not been used in project XXXXXXXXXXXX before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/tile.googleapis.com/overview?project=XXXXXXXXXXXX then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
}
}
Following the link to the Developer Console, I receive this message:
The API "tile.googleapis.com" doesn't exist or you don't have
permission to access it
Is this a Google Maps premium feature? Does any one have more information on this API?
The Tile API is not available for Standard plan users. Neither for Premium plan users [1]. It requires a special license. You should contact Google's sales team directly in order to get some additional information regarding Tile API.
[1] https://developers.google.com/maps/premium/overview#package

Maps API keys for geocoding not working anymore?

It seems that the generated keys in the Google API's console are not working anymore. With different keys (tried it with both server and browser key, however the server key is what I need), generated from different accounts I get constantly the following errors:
Error when using server key:
{
"error_message" : "This site or IP is not authorized to use this API key.",
"results" : [],
"status" : "REQUEST_DENIED"
}
Error when using browser key:
{
"error_message" : "The provided API key is expired.",
"results" : [],
"status" : "REQUEST_DENIED"
}
And these are the enabled services on this account/project: http://upload.uprise.nl/et2j
This is the URL I'm trying: https://maps.googleapis.com/maps/api/geocode/json?address=900+Maple+Avenue%2C+L7S+2J8+Burlington+%28Ontario%29%2C+Canada&oe=utf8&sensor=false&key=mykey
Without the key it is working until I reach my daily limit (which causes the OVER_QUERY_LIMIT status).
Are more people experiencing this?
I have faced same issue... But finally got resolved. Google place services will take 10 minutes to make the services available for new API KEY created. Services will stat working after 10 minutes, till then we get error as "The provided API key is expired."
Geocoding is not one of the services available through the developer console at this time, which is why the key does not work (note that geolocation is not the same as geocoding).
Currently you'd need to use client side geocoding (for example in the JS Maps API) -- or purchase more server side geocoding with a maps for business license in order to increase this quota.
The fact it says the key is expired is misleading, and I'll file a bug for that.
EDIT/UPDATE: The geocoding service is now available through the developer console.
Enable
Google Places API Web Service from google console. It's work for me.
If you're switching from the free API services to a Maps API for Business implementation, you must remove the key parameter from your requests. Google Maps API web services will deny requests made with both a client ID and a key.
https://developers.google.com/maps/documentation/business/webservices/
For me Services has started working after 7 minutes.