I'm doing an application that access a google drive and get a file for my web application. I'm doing in C# .Net 4. Does anybody how to do this? Thanks
Please follow the C# Quickstart to start your project. It will guide you to set up authentication. Then, use Files.get() to retrieve metadata of the file which has downloadUrl to download content of the file. All sample code of retrieving metadata and downloading content is available in C# in the documentation for Files.get().
Related
I am trying to programmatically retrieve my company's app data from the Google Developer's Console, specifically the daily installs. I have found that Google recommends the gsutil tool to access the data programmatically through the Google Cloud Storage SDK. However, I beleive they charge for this service. I want a free way to programmatically retrieve the data, preferably as a JSON stream to avoid dealing with file downloads. I have found the "direct reporting" links, but I have problems authenticating when I try to use them, and I also have to do something with the actual files then.
Is there a way to get a JSON version of the data through OAuth2 or something without downloading an Excel file? Has anyone had to do this?
You should look into use the Core Reporting API.
There are client libraries available in a number of languages.
You should work through the Hello Analytics APIs to get started.
Java Script
PHP
Python
Java
A quick solution for building a dashboard would also be the Embed API.
Using the gsutil tool to access the company's storage bucket that are provided by google is a free service. I wrote a code that will run the gsutil code as a process through the command line and parsed the downloaded .csv files into a database for storage. OAuth2 was not necessary.
I updated by Google Drive SDK references to 1.70 recently and updated all of my authentication code from using IAuthorizationState and the NativeApplicationClient to using UserCredentials, Drive.Auth.Store, and a DriveService object consistent with Google's "supported" method.
Everything working with my DriveService is working great. I can upload files, list files, create files and folders. Now I'm trying to figure out how to perform the simple act of downloading files by ID and I can't determine how I can leverage my new authentication code to support downloading. The SDK examples are referencing IAuthenticator but I'm not sure if that is a legacy object and my current project can't naturally reference it (missing a reference or perhaps isn't in 1.70).
I recognize that the Drive SDK may not actually have a method of downloading a file, but I'm very confused about how I can use my clean, new authentication store (Drive.Auth.Store) which has everything I should need to authenticate with the downloading action.
A point in the right direction would be most helpful! Thanks in advance for your help.
I am new using google scripts and drive-sdk.
I'd like to call the copy functionality of drive-sdk. When I try it, I get a message that says I need authentication.
Where can I find an example of how can I authenticate from a google script to authenticate de drive-sdk?
Thanks in advance.
Biagio
Have a look at the Google's Drive SDK docs regarding authentication.
https://developers.google.com/drive/quickstart-php is a good example in PHP. other languages they have quickstart examples for: Java, Python, .NET, Ruby, Javascript, Go, and Objective-C/iOS
First, view Google's information on authorising with the Drive API.
Then, choose which language you wish to use, I would reccomend JavaScript (or Node.js) if you want to play around or are making a web app.
If you wish, you can view a simplified explanation of the OAuth2.0 flow.
To clarify, the basic steps you can use to get going in JavaScript (as an example) are:
View this official Google getting started page
Set up the Drive API in the Google Developers Console
Copy the code from the getting started page
Ensure you place your ClientID from the Google Developer console into the copied code
Install Python if you haven't already (version 2 or 3)
Start the web server using Python (python -m SimpleHTTPServer 8000 for version 2) and load 'http://localhost:8000/quickstart.html' into your web browser
Is it possible to upload a file, pdf or word, from a web application made in Salesforce to a Google drive?
I have downloaded the integration toolkit for Google. I can create the file but I am not able to upload the file.
How should I do this?
You have to integrate your web application with the Drive SDK as described in the docs: https://developers.google.com/drive/apps_overview
I don't know the Salesforce integration toolkit for Google, but there are complete Drive SDK sample apps in different programming languages at https://developers.google.com/drive/examples/index
You can definitely do that. In fact I had done an implementation on the Force.com platform where users could actually upload files to their bucket of space on the Google Drive.
I have started a blog (integration-of-google-drive-into-force-com) just a few days ago and through which I am planning to pass on all my experiments that I would do the Force.com platform to every one around.
I have given a detailed description of the same on my blog. You can visit the same and do approach me for doubts and clarifications.
I am trying to fetch access token and refresh token using the document specified here. While doing so, I am faced with an issue:
java.lang.NoSuchMethodError: com.google.api.client.json.JsonFactory.fromInputStream(Ljava/io/InputStream;Ljava/lang/Class;)
Where can I find the jar which contains this class and method?
The Google Drive Java client library is based on the Google APIs Java client library. Make sure you download it as well. The zip contains the library and all its dependencies.
Also make sure that you don't have conflicting versions of the Google Apis Client library in your compile/classpath as this method is only available in later versions.