If you don't want to write your own code to send HTTP requests and parse the responses, then you must download a client library.
How to set up a client library varies by programming language. In the following section, select the language you're using for development.
If you want to use a language that isn't shown below, refer to the client library documentation to see if there's a library for your language.
Java
Using the Google APIs Client Library for Java requires that you download the core Java client library and the Google Drive Activity API Java library.
This page contains information about getting started with the Drive Activity API by using the Google API Client Library for Java. For more information, see the following documentation:
- Browse the Javadoc reference for the Drive Activity API.
- Read the Developer's Guide for the Google API Client Library for Java.
- Interact with this API in your browser using the APIs Explorer for the Drive Activity API.
Add the client library to your project
Select your build environment (Maven or Gradle) from the following tabs:
Add the following to your Add the following to your pom.xml
file:build.gradle
file:
Python
Using the Google APIs Client Library for Python requires that you download and install the Python source.
This page contains information about getting started with the Drive Activity API by using the Google API Client Library for Python. For more information, see the following documentation:
- Browse the PyDoc reference for the Drive Activity API.
- Read the Developer's guide for the Google API Client Library for Python.
- Interact with this API in your browser using the APIs Explorer for the Drive Activity API.
System requirements
- Operating systems:
- Linux
- macOS X
- Windows
- Python 2.7, or 3.4 or higher
Install the client library
You can either use a package manager or manually download and install the Python client library:
Managed install
Use pip or setuptools to manage your installation. You might
need to run sudo
first.
- pip (preferred):
pip install --upgrade google-api-python-client
- Setuptools:
easy_install --upgrade google-api-python-client
Manual install
- Download the latest client library for Python.
- Unpack the code.
- Install:
python setup.py install
App Engine
Because the Python client libraries aren't installed in the App Engine Python runtime environment, you must copy them into your application just like third-party libraries.
To do that, run the following commands:
$ hg clone https://google-api-python-client.googlecode.com/hg/ google-api-python-client $ cd google-api-python-client $ sudo python setup.py install
You can now import the classes you need using the following statements:
from apiclient.discovery import build from apiclient.oauth import OAuthCredentials import httplib2 import oauth2 as oauth
PHP
Using the Google APIs Client Library for PHP requires that you download and install the PHP source.
To do that, run the following commands:
$ svn checkout http://google-api-php-client.googlecode.com/svn/trunk/ google-api-php-client-read-only $ cd google-api-php-read-only $ # Copy the src directory to your working directory.
You can now import the classes you need using the following statements:
require_once "../src/apiClient.php";
.NET
Using the Google APIs Client Library for .NET requires that you download the core .NET client library and the Google Drive Activity API .NET library. Download the files and add them as references to your project:
You can now import the classes you need using the following statements:
using Google.Apis.Authentication; using Google.Apis.Authentication.OAuth2;