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

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.

Related

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.

exportlink for Google drive api v3

I'm switching to the Google drive V3 apis and I'm not able to retrieve the stream to the document.
Goal: I want to push a google drive document to another location and I need to retrieve the stream of the file in order to use it to push it to the target.
I can't find a way to do it using Google Drive API V3 !
In V2, I used:
downloadUrl = file.ExportLinks[(string)ExportTable[file.MimeType]];
And then I could use something like:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(new Uri(downloadUrl));
I don't find the equivalent in V3.
I tried:
var getfile = _service.Files.Get(file.Id).Execute();
var request = _service.Files.Export(file.Id, getfile.MimeType);
System.IO.Stream stream = request.ExecuteAsStream();
And the content of the stream is:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "fileNotExportable",
"message": "Export only supports Google Docs."
} ],
"code": 403,
"message": "Export only supports Google Docs."
}
}
Of course, we don't want to download it to a local file and then generate a new stream from the file cached locally. We want to remain entirely in memory.
Thanks for your help
You can see that in the Migrate to Drive v3 docs, it says that:
The exportLinks field has been removed from files. To export Google
Documents, use the
files.export
method instead.
Check that page for other changes in v3 as well.
You can also create a link yourself if you are logged in as the right user or the file is public with a link:
https://docs.google.com/feeds/download/documents/export/Export?id={{ID}}&exportFormat=pdf

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

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

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

Google Drive Realtime API "get" endpoint not working as expected

We are trying to use the Google Drive API to retrieve the model of a Realtime document (API reference). However, if I call the "get" method to retrieve details of a Realtime File generated through the Google Drive Realtime API Playground app (with a blank "revision" field), the result is always:
{
"appId": "292824132082",
"revision": 1,
"data": null
}
even after a lot of editing on the model. If I try to specify a different revision (say, "2") the result is a 500 error:
{
"error": {
"code": 500,
"message": null
}
}
Are we doing something wrong or is there a problem with this specific API?
Calling "get" using the API Playground gets the realtime document associated with the API playground app, not the realtime document associated with your app.
If you update and get both with the API playground you should see contents.