3
votes

I read the following two pages on Google: 1) https://developers.google.com/google-apps/documents-list/#getting_a_list_of_documents_and_files and 2) https://developers.google.com/accounts/docs/OAuth2WebServer

I can go as far as getting an access_token (OAuth2) to be used in a subsequent Google API call (I want to call Google Docs Listing or Google Drive).

I wanted to use curl or something similar and just form my https URL. - As such in the 1st document states to form a URL as follows: https: //docs.google.com/feeds/default/private/full - In the 2nd document, the example states to use something like https: //www.googleapis.com/oauth2/v1/userinfo?access_token=xxxxx (adding the access token to the call)

Several questions - Do I call googleapis.com or docs.google.com? - can I call https: //docs.google.com/feeds/default/private/full?access_token=xxxxx just add the access token to the call?

thanks

3

3 Answers

2
votes

You need some effort to approach a Google API the first time, but then it's easy and elegant:

  1. Manual preparation (One-time action): Sign in to Google, create a project, enable the API in question, create new Cient ID.
  2. Get OAuth code, refresh token and access token (one-time action).
  3. Make the API call (repetitive arbitrary actions).

Here is a detailed explanation of the entire process - Steps to make a Google API call. A practical sample based on the Google Calendar API with full demo code in a single HTML file can also be reviewed here - Easy and compact access to my Google calendars.

0
votes

The fastest way to get started is probably the quickstart guide for the Google Drive API, which shows how to setup your environment and write a complete command-line app to upload a file to Drive:

https://developers.google.com/drive/quickstart

0
votes

Hie you can go through the Google Docs Sample Available Here

it's a command line smaple but this same thing you can implement in android. it works for me. you will find "docs-cmdline-sample" in repo. that will help you.