Google Drive API

Thanks to this guy, whose question and gist helps me understand the google api and requests for it to get access for google drive.

google-drive[1]

http://stackoverflow.com/questions/22534959/access-google-drive-api-in-python-whithout-google-api-python-client-installed-a

I found everything!

If anybody will be confused like me:
Get your google drive your_api_key from here:

Google API KEY

in section with name «API keys» — or you can generate it by pushing «New Credentials» -> «API key»

Also you can get your token with google «quick start» even for python3:

Your token will be saved on system user’s folder (C:/Users/user/.credentials) or (/root/.credentials) for Linux if you run it under «root». The token is in «access_token» key value.

Then you can generate request, but at first check this: http://docs.python-requests.org/en/master/user/quickstart/#custom-headers

And this is working example to get list of your google drive files:

Attention!

Token is expiring very soon!

https://developers.google.com/identity/protocols/OAuth2UserAgent#handlingtheresponse

 

Для русскоязычных ребят ключевое слово: google api key получить

Curl example from docs:

Examples

A call to the drive.files endpoint (the Drive API) using the access_token query string parameter might look like the following, though you’ll need to specify your own access token:

Here is a call to the same API for the authenticated user (me) using the Authorization: Bearer HTTP header:

You can try out with the curl command-line application. Here’s an example using the HTTP header option (preferred):

Or, alternatively, the query string parameter option:

trianglesis

Об авторе trianglesis

Александр Брюндтзвельт - гений, филантроп, 100 гривен в кармане. Этот блог - "сток" моих мыслей и заметок. Достаточно одного взгляда на него, чтобы понять, что такой же бардак творится у меня в голове. Если вам этот бардак интересен - милости прошу.
Закладка Постоянная ссылка.