Issue with Google Drive API and group sharing - google-drive-api

I'm facing an issue with an application I'm developing using Google Drive.
I have a Google group with some users inside, and I share a collection with this group.
When I try to find this collection using Google Drive API (files().list()), as one of the users of this group, the collection shows up properly.
However, if I add another user to the group (either using API or Google CPanel), and try to find the collection using Google Drive API as this user, the collection doesn't show up, as if the user is not able to see it even though he is in a group allowed to see the collection.
If I manually open once the collection through my browser, then the collection is showing through Drive API.
Is this a normal behaviour ? In my use case I cannot expect from the users to open in their browser each and every collection shared with them in order for the application to work.
Any insight?

I opened a Google Support case about this and apparently this behavior is "expected". Here are some excerpts from my exchange with "Angel" from
Google Enterprise Support (typos corrected and emphasis mine):
After reviewing the stackoverflow question, we need to clarify to you that the behavior shown is expected. When adding a user to a group, this group must be added again for any files that it has been shared with.
and
All information previously provided is from internal documentation for Drive UI; however the functionality is the same for SDK, therefore, group must be deleted and added back to the list of users that have access to files/folders after adding a new member.
So, there you have it. Not sure if #Burcu will ever come back and confirm.
<EDIT> It gets worse. According to this Google document, groups with more than 200 members will never see files shared with them, even if you delete and add the group back. </EDIT>
Useless post-answer rant follows:
This behavior, even if it is "expected" by Google, does not seem to be properly documented, and it is neither expected nor usable by clients of the service. How are we supposed to know when a user has been added to a group that has items shared with it? Are we supposed to constantly monitor group memberships as well as maintain a list of all things shared with the group and then *re*share them with the group when the membership changes, just to get consistent behavior? It makes me wonder why Google doesn't already do this on the back end; it can't be that expensive to register a list of callbacks with a group that are triggered upon membership changes. And the requirement that we actually unshare is even more bizarre, since it necessitates a short period of time during which nobody in the group can access the resource.

Related

Google Drive API get AppProperties with API Key

Question:
Is it possible to access the appProperties field in a Google Drive document via an unauthenticated user (i.e., via API Key or other method rather than Oauth)?
Background:
I have an app that works as a live document editor. It authenticates users via OAuth and allows them to save those documents to their google drive, and later re-open them in my app (google file ids are saved in my database and will load the document text into my app). Create()-ing and Get()-ing these files works fine as long as the user is signed in, and I have the "appProperties" field storing a couple of additional key metadata items.
As a next step, I would like to allow users to mark a document as "public view", and provide read-only access to their file, even for non-logged-in users. In my head, the flow would work as follows:
User_A authenticates with OAuth and creates a document, saved to their google drive.
User_A presses a button in my app, which sets the google document to a public sharing mode?
App generates a "viewer" link that User_A can share with his friends.
User_B does not have a Google account, but visits the "viewer link", and my app looks up the appropriate google document (using API key? since User_B is not logged in)
Document is loaded into my app for viewing.
This seems to mostly work; I can read the file metadata just fine using the API key, and even get the file contents. Side Note: Why do we need the API Key at all, given the quote on the google drive api page: "Note: Authorization optional."
However, the "appProperties" field always returns empty when using the API key!
Edit: After further searching I am just more confused. The closest answer I could find was from this related question here on stackoverflow:
It's very simple. appPropperties is a private field and is available only to the application that added it.
Based on this, it seems Google Drive is treating requests from my app API Key and requests from OAuth users on my app as two separate apps?
Further, I would eventually like to allow users to collaborate on a single document, owned by one user. So instead of just providing a read-only "view" link, they could generate an "editor invitation" link that would allow an authenticated user (User_B gets a google account now) to be added as an authorized collaborator (but not simultaneous editing) on the original (User_A's) document. Is that even possible?
Note I am using the Node.js google api.
This might be a bug:
appProperties are app-specific properties attached to a file. Any call from this app should be able to access them. Therefore, I think calls from this app using an API key should be able to retrieve these properties.
I could reproduce this behaviour: appProperties are populated when using OAuth, but not when using an API key, even though both are created from the same GCP project.
I filed a bug:
After researching this issue, I think this might be a bug. Therefore, I decided to file a bug on Issue Tracker:
appProperties are not populated when accessing a public File using an API key
To anyone affected by this, I'd suggest to click the top-left star in order to keep track of this and to help prioritizing it.
Reference:
Add custom file properties

Export the join date for members in a group

Is it possible to export a member's join date to a google group? When you manually export a .csv from a group it gives information on the join date. However, in google app script, I don't see the option for this in the Groups Service. This is the information that is in the .csv:
Any help or resources would be appreciated!
Short answer:
No, you cannot do that programmatically.
Long answer:
Google Groups functionality is mainly handled by Directory API, in its Groups and Members resources. That's what the Apps Script Groups Service is using behind the scenes, and you could use its methods directly by enabling the Admin SDK Directory Service in your script (the APIs —and, as a result, the advanced services— usually have greater functionalities than the Apps Script built-in classes).
If you look at the properties of any of these resources (Groups and Members), you won't find anything close to a join date property, so it doesn't seem to be part of the open API, and can only be accessed through the UI.
The same can be said of Groups Settings API, which can be used to manage group settings: no join date can be found in its resources.
Because of this, you have no way to programmatically store and retrieve the group member's join dates.
Workaround (of a sort):
If you are adding members to a group programmatically, with the API method Members: insert, you could make your application store the date in which each member was added, and retrieve it later. This is not possible, though, if members are added through the UI.
Filing a Feature Request:
Since this resource does seem to exist already (it can be accessed through the UI), I'd suggest you to file a feature request in this Issue Tracker component to make this available to the API. If you do that, please make sure that you explain the usefulness of this functionality (explain how this could help you and, potentially, other users).
Reference:
Directory API: Groups
Directory API: Members
Directory API: Manage Groups

Forge API: Get all changed items

I need to get a list of all changed items in my project in BIM 360. Can I do this using forge-api.
Ho, regarding with the latest question [If my service is not available and I will miss some webhook events, how can I get all the changes that were made after the last webhook event received] :
If your requirement is to know which items are changed in one folder of Docs, Search API with filter can be of use. e.g. the endpoint below will return all items which are updated since a certain time.
https://developer.api.autodesk.com/data/v1/projects/{{project_id_with_b}}/folders/{{one_folder_id}}/search?filter[attributes.lastModifiedTime]-ge=2019-10-15
More filters options are described at
https://forge.autodesk.com/en/docs/data/v2/developers_guide/filtering/
While if you wanted to know all updates in one call, I do not see currently the way is available. While, Activity API is on the way, it might be helpful to know all activities during a certain dates, then you could filter out what you are interested in and locate the corresponding module>>files/resources etc.. but Activities may probably be categorized with specific scopes e.g. admin activities, project actives, issue activities etc. so it is not one call knows all updates.. And these APIs may not be exposed in the same time.

LinkedIn API v2 integration

I'm trying to integrate LinkedIn API v2 to the app I'm developing for my client and I need help with it. Basically, I need to allow users to fetch some of their LinkedIn profile data and save it to the platform. As I understood, the first version of the API will no longer be supported. https://developer.linkedin.com/docs
So, the problem is that the default field set I was able to retrieve is extremely limited. And it seems like I should apply for the Developer Program here to gain additional API access
https://business.linkedin.com/marketing-solutions/marketing-partners/become-a-partner/marketing-developer-program
I already submitted the application but haven't yet received any response. The frustrating part is that I'm not even sure if this is what I should do to get access.
Here's what I already discovered
Here it's said that the partner's program isn't available
https://www.linkedin.com/help/linkedin/answer/97491
Here it sends me to the partner program
https://developer.linkedin.com/support/faq
Should I choose marketing? https://developer.linkedin.com/partner-programs
I suppose so because other options seem to be irrelevant. So I already applied here
https://business.linkedin.com/marketing-solutions/marketing-partners/become-a-partner/marketing-developer-program
But still no answer
Here are the developers facing the same issues with no answer as well
https://www.linkedin.com/help/linkedin/forum/question/712591
https://www.linkedin.com/help/linkedin/forum/question/711176
https://www.linkedin.com/help/linkedin/forum/question/711027
Here seems to be the answer to a similar question but still, no specific link or steps to apply for a partner's program
LinkedIn API V2 - Can't get summary, skills and headline
Here they also tell about some partner's program but again without specifics
Linkedin oauth2 r_liteprofile not being returned from api
Here in the official doc, it's also said that I should apply to the program (which I did)
https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/migration-faq?context=linkedin/consumer/context
I applied on the 23rd of January and I'm still waiting for the approval without even knowing if this program will give me the API access I need
So I need to know one of the following
If my application will be approved it'll give me the extended access to the API v2 (r_fullprofile permission)
If the application I submitted isn't enough what else should I do in order to get the extended access to the API v2 (r_fullprofile permission)
It feels to be a simple process and I don't really understand why it has to involve the Marketing Developer Program when I only need to access some of the fields. I'm sure there is a reason for that. Could anybody from support provide some steps that I or my client should take on order to get the API access?
I already created the app as a developer here and successfully tested it
https://www.linkedin.com/developers/apps
So, just to be clear, the problem is not in something not working technically. It's just that I receive a very limited set of field of a user's profile and I need to expand it

How do I transfer the ownership of a chrome extension?

I am no longer working with the person who originally created my Chrome extension, and I need to manage and push updates to the extension for our current users.
Is there any way of transferring ownership? He is happy to do it, but has not been able to find a way.
You have to fill in some forms with Google.
You can find the Chrome Web Store account transfer request form here: http://support.google.com/chrome_webstore/bin/request.py?contact_type=dev_account_transfer
You may create a Google Group and use it as your publisher.
Remember that:
You can only set up group publishing once and create one group publisher account.
If you want to transfer extension to group, then:
Select "All Publishers" in the dashboard.
Under target group click "Transfer your existing item(s) to this publisher".
In practice I was able to share publishing access among group owners, not group participants, but you may experiment yourself.
Assuming that we're talking about an extension hosted on Google's extension gallery, there's no mechanism for transferring ownership available in the developer dashboard. Transfers of ownership have to be done manually by someone internally. The extension's owner will need to send an email to the "chromium-extensions" group explaining the situation, and someone from the extensions team will get back with you relatively soon to get the details.
Until there's a better mechanism for this (multiple owners, for instance), I'd suggest that you create a new Google account to share between the extension's owners, and ask for that address to be assigned ownership.