amit ghosh
amit ghosh

Reputation: 276

Share my google drive data using a website in asp.net

I have some files and folders in my Google Drive.And I have a website. I want to show my Google drive content in one page of my website.Any body can view the those data.

I tried this since morning.Using javascript I did that.But in that case it only show the data when I login using that Google account.But from other machine or with out sign in using my account it's not show any data.I checked from firebug it's giving a error like login required.

Can any one help me to solve the problem.I will like to do that using asp.net. Thanks in advance.

Upvotes: 0

Views: 425

Answers (1)

Burcu Dogan
Burcu Dogan

Reputation: 9213

Share a folder with public Internet, use an API key to query the files under that folder with an API key.

gapi.client.setApiKey(API_KEY_HERE);
gapi.client.drive.files.get({
    'q': '"<publicFoldersId>" in parents'
}).execute(callback);

Obtain an API key from API Console by generating a key for browsers [1].

Note: I'm using the JavaScript client library, available on [2].

[1] https://developers.google.com/console/help/#generatingdevkeys

[2] https://developers.google.com/api-client-library/javascript/

Upvotes: 1

Related Questions