Recently I've taken the time to migrate a VB.NET project that used google drive apis v2 to the v3 instead. I got the basic things to work but there are some details about storage usage and some other simple safety validations that I did that now don't work. It's quite silly actually, but I don't know how to get this to work, here's the thing:
In v2 I used this line - service.About.Get().Execute.User.EmailAddress - to get the email address that the token was created with, and then compared it to the one that the user was actually trying to upload files to, and see if they matched.
The problem is that I can't make that line work anymore, I've read in another question here in SO Google Drive API v3 Migration that this:
service.about().get().setFields("user, storageQuota").execute()
should be the new way of doing this kind of thing, but visual studio says there's not such method like "setFields" there.
Does anyone know what am I doing wrong or what is the correct way of doing this in VB.NET? Thanks.
Related
Recently Google plus is pending for shutdown, which also shutdown some Google Plus API including this one https://www.googleapis.com/plus/v1/people/me which our service is actively using.
That above API was used in one of our legacy login library, which I can't even find the source for it. Hence I am now trying to patch it myself.
Reading the migrate guide from Google, it doens't tell much in terms of how to change the url.
Referencing some open source library like 1, 2. I have come up with the fix of replacing the url https://www.googleapis.com/plus/v1/people/me with https://www.googleapis.com/oauth2/v3/userinfo, which works but oauth2/v3/userinfo lacks documentation, so I am pretty worry that oauth2/v3/userinfo is not intended to be used like the above.
So my question is:
Is my solution: change https://www.googleapis.com/plus/v1/people/me with https://www.googleapis.com/oauth2/v3/userinfo an intended migration, if not then how can I migrate out of Google Plus API?
Any documentation on https://www.googleapis.com/oauth2/v3/userinfo? The closest I can find is this, which seems more like an brief intro then a documentation.
The "/oauth2/v3/userinfo" call will not be deprecated on March 7th, 2019 as it is not part of the Google + API.
If you look at the Google Developers Console, those calls are not registered as part of the Google + API.
From Google email:
If you are directly requesting the “plus.me” scope, any other Google+
OAuth scopes, or making any Google+ API calls, please ensure that you
remove these requests from your project before March 7, 2019.
Since nobody answer, I think I will give out the best info I can gather...
For 1. Supported by multiple open source project. Pac4j, hybridauth. It seems like the method of change https://www.googleapis.com/plus/v1/people/me with https://www.googleapis.com/oauth2/v3/userinfo is the best you can do to fix this issue.
For 2. Still no detail documentation for that
i am currently work on an IOS project which is required to read data from Spreadsheet in google drive. I have done some research and i found Google APIs client library for Objective C. However, i still have problem of retrieving data from spreadsheet. i find only the sample code that can read the file in drive from the drive that user login. But what i actually want in this project is using Google Drive as the Database. In short i want to retrieve data from the url like this https://docs.google.com/spreadsheet/ccc?key=0AoYC7S60-ywcdHVZYzh4ZlZ1Y3J5R2ZGbnBqY09jdkE&usp=sharing.
So is there a solution for this kind of problem? and if there a good site that provide a good tutorial to this kindda problem?
Google apps script is probably a simpler option. You can set it up as a web app, and read/write to the spreadsheet via the webapp. The google-spreadsheet-api is hard to use as there is little good documentation.
Refer, Google's Sample Code it can help you. You can also use GData Objective C Client to use it.
With Docs API deprecated and some nice new functionality in Drive API, I'm working on updating some of my file migration scripts. However, I've found there doesn't seem to be a Drive API equivalent to the writersCanInvite parameter in Docs API v3. Being able to set this attribute on a file would be extremely important during migration scenarios as without it, the migrated file would be left open to having editors share it out further.
Not having writersCanInvite avaialble in addition to not being able to see email addresses (or some Unique ID) for the ACLs is preventing me from fully porting over my migration script to Drive API v2.
Thanks Guys,
Jay
It looks like we now have a writersCanShare attribute that controls this:
https://developers.google.com/drive/v2/reference/files#resource
at the moment, it's not marked as writeable but I had no problems making it False for a new document so I'm guessing that's just a documenation issue.
I'm a student working on a project related to SEO; I need to write an optimization tool, so I'm writing an application using C# and Windows Forms. The main part of the application is for keyword selection, and I want to use the Google AdWords API to obtain a list of keywords.
I downloaded the C# client library, but can't understand how to set up the project: I am getting the error:
"An API exception has occurred. See ApiExecption and InnerException fields for more details".
Maybe I have made a mistake when I edited the App.config file as I haven't changed anything else. Can anyone advise me where I should begin? I would be grateful to hear your ideas.
Unfortunatley, the AdWords API isn't as open as you might think: It's meant for ad agencies managing large accounts, or software vendors who want to build ad management platforms. You need to apply to Google for an API key to gain access; they used to give them out to nearly anyone with an account, and it took about 14 days to process the application. However, Google has got very strict about their terms and conditions over the past 12 months, and to put it simply, you probably won't meet them if you're building an SEO tool; even if you apply to build a full platform, you'll need to wait six to ten weeks for approval as they've got a huge backlog of applications to process at the moment.
As this is just a student project, you should actually be able to get away with just using the AdWords API sandbox, which is open to anyone with a Google account. This won't give you real keywords or stats, but would demonstrate your understanding of the platform.
Another option would be to check out the Ad Intelligence Service of the adCenter API; you'd still need to open an adCenter account (with a $5 activation fee), but you should be able to get an adCenter API key without waiting too long. The stats available from Microsoft won't be as extensive as what Google has to offer, but will still be relevant to the at least the US market. Also, being Microsoft, they've got a good range of C# examples.
You could use the sandbox, but it is good only for testing purposes. You won't get real values for traffic estimation and keyword ideas.
To use the sandbox, what you need is a Google account (your gmail account for instance). To initialize the sandbox,
In your App.config, put email/password/developerToken as your email / your password / youremail++USD (e.g. john.doe#gmail.com++USD)
Run the GetCampaigns.cs code example. It is under v201109/BasicOperations folder in the C# examples project. This will initialize the sandbox.
Run the GetAccountHierarchy.cs code example. It is under v201109/AccountManagement folder. This will give you 5 client emails and their customer ids.
Use one of these customerIds in the ClientCustomerId field of App.config.
Run any other code example.
The video is a bit outdated, due to recent changes in AdWords API, I need to update it.
you can find a very good article series about adwords api there: Google Adwords API
it is not that hard to learn how to use it! I think the API itself is very good documented and there is a good suppo from google.
Map a network drive to be used by a service
My question is relatively similar, and I realize there are others that are.. but I can't get it to work. I am creating the service thru visual studio 2010.
I attempted to map using WNetAddConnection2- and it successfully maps and is instantly lost (check if drive is mapped right after mapping it).
So I tried something else..
I saw some information about using WSH.. I added the reference and tried using wsh... didn't work.
I tried WNetUseConnection and that failed as well.
Attempted running the service under a different profile- that didn't work
Once I actually get access to the network drive, i need to copy files from that share into a local directory.
Maybe I'm missing the boat here but If someone could give me a thorough explaination of what is actually going on and a direction to head I can probably figure it out
Use the System.Security.Principal.WindowsIdentity class' Impersonate Method with the credentials of a user that has access to that drive and then try to grab the files.