This tutorial shows how to create a project and enable the Google Drive API for a specific Google account, and get access credentials.

1) Log in with your Google account in the reserved area where you can configure Google APIs, from this URL: <https://console.developers.google.com/apis/library>

  

![](https://help.scriptcase.net/galleryDocuments/edbsn8daa75e334887a0efb822868784d64a51abbb4a513af0a4922314da60ec19e69e97f360d60ef7f61983e5d5dec5487db?inline=true)

2) After login select or create a new project:

![](https://help.scriptcase.net/galleryDocuments/edbsn06cede1066212757cd7e34514e2523c9e75fd2dff2289a81432cc9d8b892d79720f92615833874c6d2a421fa4e97b622?inline=true)

3) Create or select an existing project:

![](https://help.scriptcase.net/galleryDocuments/edbsn773dbf567b92500634f3342b6c86808e58b87cd87d25f0ed35df7863baaea9b35831454de17e316d91a11d7f2187f3e8?inline=true)

## Creating a Project

1 -  Enter a name and the organization your project will be linked to:

![](https://help.scriptcase.net/galleryDocuments/edbsn7c148d9d901ce384f24656eddfc35e5c65789320c5f3305923ce78a0ce8ff04fa65e6ad4955ea74ce10bdbca65b53099?inline=true)  

2 - Then click on the “**Select Project**” item to access the project:

![](https://help.scriptcase.net/galleryDocuments/edbsn6aeef5c5b8923965b424b5aa204ee7f08f49e388b3ee2c3841f887b8c854e1a31d9b46ad0692b40a4878aaaf52c36049?inline=true)

## **Enabling API**

1) Click on the item “**ACTIVATE APIS AND SERVICES**”:

![](https://help.scriptcase.net/galleryDocuments/edbsnc645473599edd264d483499f692868cd406e4989bfd0ec15a959f3afd158679dc18574302c856f46bd53a56bfe57ea73?inline=true)

  

2) Search for "**Google Drive API**", select this option and on the next screen click "**ACTIVATE**":

![](https://help.scriptcase.net/galleryDocuments/edbsn1ba692276bac0431db06bc069f83bdcbbc3f29ea081f64cbb1ddb0c1d647a46d3d2aeade8743e5153472a57d338b63e5?inline=true)

3) In the left menu ("**APIs and Services**"), click on "**OAuth Permission Screen**":

![](https://help.scriptcase.net/galleryDocuments/edbsn6aeef5c5b8923965b424b5aa204ee7f02463e4c714229e972c14deb7f069c220a7c4a99dd8d4415be2346ba1884ce3b5?inline=true)

4) Check the “**External**” option and click the “**Create**” button:

![](https://help.scriptcase.net/galleryDocuments/edbsnc645473599edd264d483499f692868cd53658a1f655def73ea1839683497830b6e33da51eb39b8465ed008bfd8377b53?inline=true)

5) Enter the name of your application and click on the "**SAVE**" button:

**NOTE: Leave all other options at their default values.**

**![](https://help.scriptcase.net/galleryDocuments/edbsne607224c0cef1a855f99796b0f773322c4af4838f1c91b50a0d906908f0596273c51e06fb9fb8eda8a33a31e6f4b2149?inline=true)**

## Using credentials in local environment

1) After creating the OAuth consent screen, select the item “**Credentials**” from the left menu (“**APIs and services**”)

![](https://help.scriptcase.net/galleryDocuments/edbsn70beb02ec138ac89f1f16072dd83fcdc08b3e32b172840d164199f32d6f3fcbd743bcba2a7a0972605109a08679b5b71?inline=true)  

2) Click on the “**CREATE CREDENTIALS**” item.

  

![](https://help.scriptcase.net/galleryDocuments/edbsn1ba692276bac0431db06bc069f83bdcba4b5470d3e9e2ddc358b6fbc1cccdc77068c0834e63c5919a67e3f1f619befcd?inline=true)  
3) Select the “**OAuth Client ID**” item

![](https://help.scriptcase.net/galleryDocuments/edbsn8daa75e334887a0efb822868784d64a5e1469d439cf07a1bc0d148f16db65eab38e5c15ee7687dd2e1d693c195504066?inline=true)  

4) Select the “Web App **Computer App**” option, type the name and click “**Create**”.

![](https://help.scriptcase.net/galleryDocuments/edbsne607224c0cef1a855f99796b0f77332208dcd43286e4d689e8f48f5e909b542eed45590e10bc4b616b310c8d2ef7a799?inline=true)  
  
10) Immediately, “**Customer ID**” and “**Secret Key**” of the customer will be created. Click OK.

![](https://help.scriptcase.net/galleryDocuments/edbsnea6104e69fa98e4d4d64e9d0f09532e74fe0d4f5ed2ccd63e750a938fafdb6069336dfbfcfe597ec953f17728a9cf4b3?inline=true)

## 

## Using credentials in external environment

1 - To use your credentials in an external environment, go to the "**CREATE CREDENTIALS**" button again and select the option "**Help me choose**":

![](https://help.scriptcase.net/galleryDocuments/edbsnf115ed00d4152f631707f426da9b8764551d4aacfe0a6b19ba9bc4a8ec2e8e4124ba41d131221c700a9d6d35df5995a5?inline=true)

2 - Select the options:

1. Select an API: **Google Drive API**
2. Check the option: **User data.**
3. Click the **NEXT**button

![](https://help.scriptcase.net/galleryDocuments/edbsn4f98f05f487d69cc572bbac4c08abbfb463bb99dcbe181b97d1d2711277eb007d652a8435336b1b7375cd585529194bb?inline=true)

3 - On the scopes screen, click on the button to “**Add or remove scopes**”:

![](https://help.scriptcase.net/galleryDocuments/edbsnb56ea697c6ace336d869c09b4477922a60a862b0e2a448b3d2a7b66c79c01b0573976685b75f6310a4e87c8101a6493c?inline=true)

4 -  Enable all extensions containing the API name: **Google Drive API** and **Google Sheets API**. Click the button to “**Save and continue":**

**![](https://help.scriptcase.net/galleryDocuments/edbsnf115ed00d4152f631707f426da9b8764446a49a11bc4bda52c610b82c27bbebb9e7a9c5092d39b6cb011633befd985d8?inline=true)**

**5 - In the next step, select the option: “**Web application**” and inform the name of the application:**

**![](https://help.scriptcase.net/galleryDocuments/edbsn1411c4728455cb161b76bb84185216e4af0acc64e4b66e767e9fd5886660e13c1984f1daba8e34f00548c6031d1467ca?inline=true)**

![Notes](https://static.zohocdn.com/zoho-desk-editor/static/images/file.png/)

This name will be informed in the scriptcase API interface credentials

6 - In the Redirect URL option, click to add your URL then click on the “**CREATE**” button:

**Click **CONCLUDE** to finish the process.**

![Warning](https://static.zohocdn.com/zoho-desk-editor/static/images/caution.png/)

You need to add the full path.

**Example for the production environment:**

https://www.yourdomain.com/scriptcase9/prod/third/oauth/google-api-php-client-2.1.3/code.php

![](https://help.scriptcase.net/galleryDocuments/edbsn1411c4728455cb161b76bb84185216e49699cb878dff78f277ca3f62576b1988e64ddc66fe7c32a605590a9a2805f768?inline=true)

## Adding the API on Scriptcase

1) After creating the credentials, download the JSON file in the registry that was created:

![](https://help.scriptcase.net/galleryDocuments/edbsnddb9613c5c1f04b7641fbcff2ffd741d0997e0be62bff5798bb14b80a0d2fecc9ff14c60833cd86ccb931ea253ba231c?inline=true)

2) After this procedure, access the scriptcase “**API**” interface:

- Enter the name of the application created in the OAuth consent screen in the API settings.

- In the JSON OAUTH field, insert the content of the **JSON** file downloaded in the previous procedure.

NOTE: After entering these values, click on the “**AUTH**” button.

![](https://help.scriptcase.net/galleryDocuments/edbsn1411c4728455cb161b76bb84185216e411666503a471dc60214fd88e7b3469c65e08af94299282f26e195050eeadc570?inline=true)

3) Soon after, select your gmail account again, as the authentication code will be generated. Copy and paste the “**authentication code**” into the API settings field and click the “**SAVE**” button.