Google Drive API: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
(Created page with "1. Set up new project in Google Developer Console. 2. In Overview, enable Drive API 3. Go to Credentials 4. You'll see the question "Where will you be call the API from...")
 
No edit summary
Line 1: Line 1:
1. Set up new project in [[Google Developer Console]].
1. Set up new project in the [https://console.developers.google.com/ Google API Console].


2. In Overview, enable Drive API
2. In Overview, enable Drive API
Line 5: Line 5:
3. Go to Credentials
3. Go to Credentials


4. You'll see the question "Where will you be call the API from?"
4. You'll see the question "Where will you be calling the API from?"
Answer with "Web Browser (javascript)"
Answer with "Web Browser (javascript)"


Line 13: Line 13:
5. Click on "What credentials do I need?"
5. Click on "What credentials do I need?"


6. "Authorized JavaScript origins:"
6. For "Authorized JavaScript origins:",
Enter the name of your server, i.e "https://www.nsbasic.com"
enter the name of your server, i.e "https://www.nsbasic.com"


7. Click on Create client ID
7. Click on Create client ID


8. Product name show to uses
8. On Credentials screen, select Create credentials.
TestSpreadsheet


9. Copy credentials: Client ID. It will look something like this:
9. Choose API Key
304468290387-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
Copy this into the CLIENT_ID variable in your Google Drive App.


10. On Credentials screen, select Create credentials.
10. Choose Browser key


11. Choose API Key
11. Create. Note: It may take up to 5 minutes for settings to take effect


12. Choose Browser key
12. Your credentials screen should now look like this:
[[File:Credentials]]


13. Create. Note: It may take up to 5 minutes for settings to take effect
13. Copy credentials: Client ID. It will look something like this:
304468290387-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
Copy this into the CLIENT_ID variable in your Google Drive App.


14, Copy API key. It will look something like this:
14. Copy API key. It will look something like this:
AIzxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
AIzxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Copy this into the API_KEY variable in your Google Drive App.
Copy this into the API_KEY variable in your Google Drive App.


15. Run the GoogleDriveListAPI app. A permission screen will display. Click on "Allow".
15. Run the GoogleDriveAPI app. A permission screen should display, based on the credentials you entered. Click on "Allow".


16. If the Authorize button is enabled, click on it. You are now able to access the Google Drive API.
16. If the Authorize button is enabled, click on it. You are now able to access the Google Drive API.

Revision as of 18:02, 20 May 2016

1. Set up new project in the Google API Console.

2. In Overview, enable Drive API

3. Go to Credentials

4. You'll see the question "Where will you be calling the API from?" Answer with "Web Browser (javascript)"

"What data will you be accessing?" "User Data"

5. Click on "What credentials do I need?"

6. For "Authorized JavaScript origins:", enter the name of your server, i.e "https://www.nsbasic.com"

7. Click on Create client ID

8. On Credentials screen, select Create credentials.

9. Choose API Key

10. Choose Browser key

11. Create. Note: It may take up to 5 minutes for settings to take effect

12. Your credentials screen should now look like this: File:Credentials

13. Copy credentials: Client ID. It will look something like this: 304468290387-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com Copy this into the CLIENT_ID variable in your Google Drive App.

14. Copy API key. It will look something like this: AIzxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Copy this into the API_KEY variable in your Google Drive App.

15. Run the GoogleDriveAPI app. A permission screen should display, based on the credentials you entered. Click on "Allow".

16. If the Authorize button is enabled, click on it. You are now able to access the Google Drive API.

17. Click on "List Files". The files on your Google Drive will appear, along with their File IDs.