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.
Related
I have spent a lot of times creating a project in https://console.cloud.google.com, enabling the Drive API, creating server account credentials, and finally writing a small NodeJS integration allowing me to read and write files to Google Drive.
My intent is to be able to store files (organized in folders) on Google Drive from my server, and see them in the classic Google Drive desktop app with my Google account to check everything is fine.
My project seems correctly setup and I was able to create files from my NodeJS program (the files exist, I can list them with the same program), but I can't see the files anywhere in Google Drive with my Google account, with which I created the project.
I was expecting this to be extremely simple. That I would have a out of the box Drive UI allowing me to review the changes.
In the documentation they say I can configure a UI integration but I don't know if this is what I am looking for or not. It seems complicated, talking about my "app" etc, while I just want a simple Google Drive UI for it !
Could anyone help me understand all this ?
Thanks
Is there a Google Colab API? I'm looking to accomplish things like:
Create users
Create notebooks
Share notebooks with users
Retrieve the contents of a notebook
As pointed out in the other answer, Colab Notebooks are files on your Google Drive. Hence, sharing them or retrieving their contents can be done via the Google Drive API (from what I understand you can use the webContentLink to download it).
However, your first question is:
Where is the Google Colab API?
For anyone coming here from Google trying to find the official Google Colab API (because it's one of the top results when googling for now), here is the answer:
[As of summer 2020] Since this is merely a research project, there is no official API documentation and very limited documentation.
Official Documentation (very limited)
Google Colab: Official FAQ
The Google Colab: Official Feature Demo exemplifies most features. Use it to learn many of its capabilities.
The API in code
Beyond those resources, your best bet would be going to the Official Github Repository. Here are some highlights from the code:
Github: google.colab
Github: google.colab.drive
Github: google.colab.drive.mount (used in quite a few snippets)
Github: google.colab.files (provides download and upload utilities)
Github: google.colab.snippets (add snippets to the snippets list programmatically; FYI: you can find all snippets by going to Insert -> Snippets)
Github: all packages
More Notes
The FAQ explains many important mechanics. Highlights include:
It’s a Jupyter notebook environment that requires no setup to use.
Convinient!
I heartly recommend checking out the Official Feature Demo; it's how I found out that it even supports LaTeX and MathJax! (but then again that might not come as news to someone with experience in Jupyter) 😄
Virtual Machine
The FAQ also mentions...
Code is executed in a virtual machine dedicated to your account. Virtual machines are recycled when idle for a while, and have a maximum lifetime enforced by the system.
That is why you can execute all kinds of the usual system calls (e.g. !pip install, open etc.) and it just works.
However that is also why when you come back the next day...
drive.mount asks for your permission again
you have to re-install all packages
any newly created files are all gone (unless you put em in a drive-mounted folder)
Google Colab Notebooks are just like a normal file in Google Drive.
So, you can use Drive API to manage them just like any Drive files.
For example, you can share notebooks with Drive REST API as documented here
https://developers.google.com/drive/api/v3/manage-sharing
I have a Chrome Packaged App that I want to be able to graph data for the user. I would ideally like to interface with something along the lines of the Charts/Visualization API, but I'm trying to find a solution that will work offline, possibly through integration with other apps or within my app specifically. Is there a way to insert a Google Chart or something very similar into my packaged app? Is there an API or feature I am unaware of that would make this feasible?
Unfortunately the Google Charts library cannot be downloaded for inclusion in a packaged app due to their terms and conditions:
Sorry; our terms of service do not allow you to download and save or host the google.load or google.visualization code.
- Google Charts FAQ
That said, there are many excellent Javascript libraries that are available for download which you could include with your packaged app and use as if they were included from a remote source.
This stack overflow question should help you decide between the various options. You should then download the Javascript files for the library you chose and place them within the folder of your packaged app and then use them like any local Javascript that you've written.
I have couple of Perl scripts that uploads / reads files from Google drive. Is it possible to access Google drive with Perl Api, or I need to switch to python or some scripting languages that Google supports.
We have a REST API. You can use any language to implement your own client, you don't have to use one of the client libraries we support.
An overview of the resources are here: https://developers.google.com/drive/v2/reference
Auth is explained on https://developers.google.com/accounts/docs/OAuth2#webserver
File upload is explained on https://developers.google.com/drive/manage-uploads
I just found a nice cpan module for talking to Google drive. So it might be as useful to you as it will be to me, because I just started playing with it. The only thing that is weird about it is that it needs to run install script to create the initial credentials on your machine.
http://search.cpan.org/~mschilli/Net-Google-Drive-Simple-0.03/lib/Net/Google/Drive/Simple.pm#SYNOPSIS
I have an existing Android app project which has been already published on the Google Play, and now I would like to incorporate in my app the possibility to use the Google Drive possibilities in order to download *.jpg files directly to the sd card when the app is opened or load for the first time. Like this I liberate the internal memories of the phones where this app is installed (All the images are stored in the resources of the app actually which is >~ 20MB). I have read a lot of forums concerning the Google Drive SDK or API subjects and I can say that I'm a little bit lost on the manner to manage it for my present app. Some ideas or suggestions would be very very very appreciated.
Thank you very much).
Please see this question for the basics on how to integrate your Android app with Google Drive SDK: Access to Google Drive from self implemented Android application
In it, I reference a good Google+ tutorial on how to get started, and it's easy enough to take the concepts and apply them to an existing app. (That's how I did it too.) Before you get started, sign up for the Google APIs (https://code.google.com/apis/console/), get into the API Console, and turn on both the Google Drive API and Drive SDK. This'll make coding go a lot smoother. Let me know if you have any problems.
One addendum for your specific case relating to *.jpg files is you could set a MIME type for fetching strictly the pictures. It'd go something like this:
request = service.files().list(); // .setQ("mimeType=\"text/plain\"");
Unfortunately setQ is commented out because it would fail to return any results when I used it. However, you may have better luck with the image/jpeg MIME type.