|
Component family |
Cloud / Google Drive |
|
|
Function |
This component opens a connection to access a Google Drive |
|
|
Purpose |
This component allows you to open a Google Drive connection that |
|
|
Basic settings |
Application Name |
Enter the application name required by Google Drive to get access to its APIs. |
|
|
Access Token |
Enter the access token required by Google Drive to access a Google Drive account and operate |
|
|
Use HTTP Proxy |
Select this check box if you are working behind an HTTP proxy. |
|
|
Proxy Host |
Enter the IP address of the HTTP proxy server. This field is available only when the Use |
|
|
Proxy Port |
Enter the port number of the HTTP proxy server. This field is available only when the Use |
|
|
Use SSL |
Select this check box if an SSL connection is used to access Google Drive. |
|
|
Algorithm |
Enter the name of the SSL cryptography algorithm. This field is available only when the Use |
|
|
TrustStore File |
Browse to or enter the path to the certificate TrustStore file that contains the list of This field is available only when the Use |
|
|
Password |
Enter the password used to check the integrity of the TrustStore data. This field is available only when the Use |
|
Advanced settings |
tStatCatcher Statistics |
Select this check box to gather the Job processing metadata at the Job level as well as |
|
Global Variables |
ERROR_MESSAGE: the error message generated by the A Flow variable functions during the execution of a component while an After variable To fill up a field or expression with a variable, press Ctrl + For further information about variables, see Talend Studio |
|
|
Usage |
This component is more commonly used with other Google Drive components. In a Job |
|
|
Limitation |
n/a |
|
To use Google Drive APIs, you need first to obtain the access token by completing the
following steps using Google Chrome with the REST Console extension installed:
-
Go to the Google Developers
Console and select an existing project or create a new one. In this
example, we create a new project TalendProject.
-
Select the newly created project, click APIs under
APIs & auth and enable both the
Drive API and Drive
SDK APIs by setting their status to ON.
-
Click Consent screen under APIs & auth and create a new product. In this
example, it is TalendProduct.
-
Click Credentials under APIs &
auth, create a new client ID with APPLICATION TYPE set as Installed
application and INSTALLED APPLICATION
TYPE set as Other.
The created CLIENT ID, CLIENT
SECRET, and REDIRECT URIS will
be used for obtaining the access token.
-
Generate the authentication code by performing an HTTP GET request using a web browser. To
do this, copy and paste the request URL https://accounts.google.com/o/oauth2/auth with the following
query string parameters into your web browser’s address bar, press Enter and accept the access request.-
client_id: the value of CLIENT ID from the Credentials view.
-
redirect_uri: the value of REDIRECT URIS from the Credentials view.
-
response_type: the value is code.
-
scope: the auth scope that expresses
the permissions you request users to authorize for your app. For more
information, see https://developers.google.com/drive/web/scopes. -
access_type: the value is online.

Note that the request URL and the query string parameters are concatenated with a question
mark ?, and every two query string parameters
are concatenated with an ampersand &. An
example URL is shown below, with line breaks for readability. You need to join
all these lines into one line before copying and pasting the URL into your web
browser’s address bar. The scope used in this example has full, permissive scope
to access all of the user’s files. Request this scope only when it is strictly
necessary.123456https://accounts.google.com/o/oauth2/auth?client_id=1061335238805-gmctuidvid0lsrdf66nvit0g7j5gnrck.apps.googleusercontent.com&redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code&scope=https://www.googleapis.com/auth/drive&access_type=onlineThe response returned contains an authorization code that will be used to generate the
access token in the next step.
-
-
Generate the access token by performing an HTTP POST request using Google REST Console. To do this, copy and paste the request URL
https://www.googleapis.com/oauth2/v3/token with the following
query string parameters into the Request URI
field in the Target area, select the Content-Type check box and set its value to application/x-www-form-urlencoded, then click the
POST button.-
code: the authorization code
generated in the previous step. -
client_id: the value of CLIENT ID from the Credentials view.
-
client_secret: the value of CLIENT SECRET from the Credentials view.
-
redirect_uri: the value of REDIRECT URIS from the Credentials view.
-
grant_type: the value is authorization_code.

Note that the request URL and the query string parameters are concatenated with a question
mark ?, and every two query string parameters
are concatenated with an ampersand &. An
example URL is shown below, with line breaks for readability. You need to join
all these lines into one line before copying and pasting the URL into the
Request URI field.123456https://www.googleapis.com/oauth2/v3/token?code=4/fwRIPH2a8XQRCs2JicTs4zWTprKjyJ7KbwkY46fE1O0.sj6y9PmBGe8ZeFc0ZRONyF4NK_eblwI&client_id=1061335238805-gmctuidvid0lsrdf66nvit0g7j5gnrck.apps.googleusercontent.com&client_secret=x6Jis-fzAzBfCfrLlokuPopn&redirect_uri=urn:ietf:wg:oauth:2.0:oob&grant_type=authorization_codeThe response returned contains the access token. Note that the access token
expires in every 3600 seconds.
-
For a related scenario, see Managing files with Google Drive.