Convert docx to gdoc ( OpenWithLinks = null ) [duplicate] - google-drive-api

I am hoping to programatically open a drive file with a particular app using the Google drive APIs.
The aim is to mimic the GUI drive method of launching an app using the "Open With" context menu for a selected file.
While I can get a list of the available apps using apps list method, the app resource doesn't detail the Open URL as far as I can work out.
Does anyone know if it is possible to obtain the Open URL using the APIs?

I believe if you have the scope set for drive.apps.readonly you should be able to use the File method getOpenWithLinks to discover the URLs. Just testing it now, the getOpenWithLinks method isn't available on the File class. I wonder if it has been deprecated? Certainly I can't find evidence of it being so.
https://developers.google.com/resources/api-libraries/documentation/drive/v2/java/latest/com/google/api/services/drive/model/File.html#getOpenWithLinks()
Revision: the getOpenWithLinks methods are available again in revision 75 of the v2 drive API.

Related

Google Drive API grant access to another/multiple Apps

Currently, we have a mobile App that is storing data into a Google Drive folder using the scope
https://www.googleapis.com/auth/drive.file
View and manage Google Drive files and folders that you have opened or created with this app
Now we are planning to add a web app as well. The problem is, that the web app cannot access files uploaded by the mobile app and vice versa.
So is there a way to tell the Google Drive API that those two apps (web app and the mobile app) are in fact the 'same' application?
I want to avoid using the scope for full access to the user's Google Drive.
https://www.googleapis.com/auth/drive
Or is there another way that both apps can read/write the same folder?
Thanks in advance.
I also took a look at the Google Picker API but it does not seem to be what I want.
Posting this for documentation purposes.
As mentioned in comments, both apps should be part of the same Google Cloud Platform project, that's the only way to "tell" the API that they are the same application.
If they are not part of the same project, you should use the drive scope instead.

How to integrate google-drive with google apps using APIā€¦?

i need to know how to open google drive files in google apps(like actual google drive file open) with API.Please give me an idea to implement this.
To integrate your application in Google Drive, first you need to enable the Drive API and provide configuration details in your API project and this part of documentation will explain you with that.
Then the Drive UI Integration part will contains fields to enter information describing your application. The Application Name and Short Description fields are displayed to users in the Manage apps dialog in the Drive UI
Go to Drive API, then after you enable, you can see the Drive UI Integration tab.
For the Opening of files, this link will help you on that. There is also a sample code here that will serve as a guide on you.

Google Drive / List files in folder

I have little question. Is there any way (I read API, but maybe...) how to list files in folder using only Google Drive API? I mean without scopes Documents List API.
If I send request GET https://www.googleapis.com/drive/v2/files then I get all files and folders in my Google Drive, but I want to show only files which is inside specific folder.
My english is bad, but I hope you understand me.
If not any way to do this, then I must use Documents List API.
Thanks for answers
PS: I make app in C++/QT for MeeGo and Symbian OS mobile systems
Solved. I must use Search string parameters with =q

How can I build a Desktop client for Google Drive?

I want to build desktop application for Windows OS and use Google Drive to save some data in the cloud. After reading Google Drive SDK I found that only Web-applications, were installed from Chrome Web Store are allowed to use API and have access to data on Google Drive.
So my question: do I have any way to build native client (C++, Windows) for Google Drive? I know about hacks with using Google Docs API - but they can stop working any time, and I want something stable. Why Google team do not allow me create desktop application for their service? I have support of many other cloud storages and they do not have such restrictions.
Thanks.
For now you will have to use the (older) Google Document List API which provides full read-write and list access to Google Drive. (Google Drive and the former Google Docs use the same data)
So until we extend the capabilities of the current Drive API to cover the Google Document List use case you should use that instead.
EDIT: We just launched the v2 of the Google Drive SDK so you should now use that instead.
I have been working on a similar problem. I have realized that there is no straight forward way for doing this. Google Drive SDK is not easy to work with and how someone can simplify the process of connecting desktop application to Google drive shortly. I know this is not much help, but I am looking for a soltuion as well.
Here is some links that I have come across, haven't solved my problem either, but if you come to a solution please let us know PLEASE:
How to make GUI Client to upload file in java
Using Java APIs for downloading file from the Google Drive
http://www.coderanch.com/t/643120/Servlets/java/upload-file-drop-box-file

Access to all files on a user's Google Drive

The api's for SkyDrive and Dropbox have options for managing the user's entire drive. For Google Drive, the drive.file scope seems to give only access to the files created by the app.
Is there a scope for Google Drive that gives access to the entire drive?
Edit: The below answer was correct, but the latest version of the Drive API allows requesting of a full scope with https://www.googleapis.com/auth/drive. The Documents List API is no longer needed for this use case. See https://developers.google.com/drive/scopes#requesting_full_drive_scope_for_an_app
To be precise the Drive API gives access to Files created by the app and files that the user has opened with the app from the Drive UI (through open-with).
To manipulate all of the Drive files of the user you can use the Google Document List API . Though we currently forbid Drive applications (the ones that have get integrated in the Drive UI through the Open-with and Create dialogs) to request access to the Document List API as we want to keep Drive application on a per-file security model. (Basically adding the Document List scope in the Drive SDK settings raises an error).