Using the Quip API, how can you get a list of all threads? - api

I need to get a list of all publicly-visible Quip documents in my company using the Quip API. I have a service worker account that will make the API calls.
My question: how do I find the root folder to start from?
Quip's API docs tell you how to get info about one or more folders using Get Folders by passing in the folder ids. You can call this again for nested folders, and you can call Get Threads to get information about each document. (Quip uses the terminology "threads," not "documents.")
But where do I start? I need a root folder to start recursing from, right.
Here's what I've tried:
The Get Folders docs say "To find your desktop or archive folder ID, see Get Authenticated User." I've tried that but it returns folders called Desktop, Archive, Starred, Private, Shared, and Group.
Desktop seemed like a good place to start but its only child is Archive, and...
Archive only contains a couple dozen docs. The meaning of the Archive folder is not documented.
Starred is docs you've favorited.
Private is your private docs.
Shared is docs that have been shared with you.
Group seemed promising because the Folders UI at quip.com/browse shows the word "Group Folders" at the top. But my account's Group Folder list is empty.

A bit late to this, but since the QUIP API is poorly maintained and not well documented, for those looking to solve the same problem, here is one way:
Step 1: Add your company's root folder to your favorite (Starred folder), and drag it to the top of the favorite list.
Step 2: Get you authenticated instance:
quip_client = quip.QuipClient(access_token=login_token)
user = quip_client.get_authenticated_user()
print (user)
You will retrieve a json result with basic information like name, id... and most importantly the starred_folder_id for the user.
Step 3: Pass the starred_folder_id to the get_folder method:
print (quip_client.get_folder("starred_folder_id"))
You will receive yet another json with a key named as children which contains values of your starred folders/files in the order it appears on your quip app. The first folder_id will be your company folder id.
You can now use the folder_id to retrieve the rest of your company documents by more get_folder.

Related

How to get MS Teams' channel files and folders

I'm working on an API and i want to get Files and Folders of a specific teams' channel. I've tried with Graph Explorer but could not find anything resource. I have also tried the official documentation Microsoft Graph API.
I have tried the following API in explorer but it does not give the desired results.
https://graph.microsoft.com/v1.0/teams/{teamId}/channels/{channelId}/filesFolder
It is highly possible that i might have overlooked the my required resource but can someone help me out in it. Thanks
You are using the correct endpoint
GET https://graph.microsoft.com/v1.0/teams/{team_id}/channels/{channel_id}/filesFolder
returns metadata about driveItem.
Use parentReference.driveId and id in the next API call to get folders and files
GET https://graph.microsoft.com/v1.0/drives/{drive_id}/items/{id}/children
It returns a collection of driveItems with unique id.
If driveItem represents a file then file property is not null.
For each item that represents the file you can call
GET https://graph.microsoft.com/v1.0/drives/{drive_id}/items/{item_id}
to get more details about the file.
If driveItem represents a folder then folder property is not null.
For each item that represents the folder you can call
GET https://graph.microsoft.com/v1.0/drives/{drive_id}/items/{item_id}
GET https://graph.microsoft.com/v1.0/drives/{drive_id}/items/{item_id}/children
to get more details about the folder or to get items inside the folder.

Can I get children using folder name and id in the same time using Microsoft Graph API?

I am trying to display folder and file list from a Sharepoint in my CakePHP web application.
Please review my previous question here.
What I am going to do is to get children from a folder with id and also inner folder with name, in the same time, using Graph API.
I want to get list from an api like
https://graph.microsoft.com/v1.0/drives/{drive-id}/root:/{folder-name}:/items/{item-id}/children
I am not sure if it is available and how to implement it.
At this moment, I can get children from a folder with its name.
https://graph.microsoft.com/v1.0/drives/{drive-id}/root:/{folder-name}:/children
And I can filter the response using query parameters like below.
https://graph.microsoft.com/v1.0/drives/{drive-id}/root:/{folder-name}:/children/?$filter=id eq '{folder-id}'
Can I get sub folder's children at this moment?
Any help?
There is no such method. As #Shiva said, their properties are the same. You cannot use the folder name and folder ID at the same time. You can try the api provided by Shiva. I think it is a good method:
https://graph.microsoft.com/v1.0/me/drive/root:/{folder-name}?$expand=children

Explore shared folders and get global informations

I want to make a program with the google drive API.
But I am not sure if this is possible. I want to make a program who explores my shared folders. Go into the last folder, give me all global information (date/owner/what inside/size of the folder/if he got folders in him). And after coming back in, "his father folder" and continue to give me the same information.
BUT ! If the "father folder" has a second child, he gives me the second child information first.
I just want to know if this is possible and if is not too complicated( I an not an expert).
Thanks for your help.
Hello every action ou described is possible !
Have a look at https://developers.google.com/drive/v3/reference/
You can list, filter, get informations on files and folders delete, share, insert
Good luck
You have to use sharedWithMe, when using the Querying for Files:
The "Shared with me" category includes files owned and shared by others users which have been either: directly shared with the current user, a group containing the current user, or have been accessed by the current user.
Here is sample snippet that search for files shared with the authorized user with "hello" in the name:
sharedWithMe and name contains 'hello'
For "Go into the last folder, give me all global information (date/owner/what inside/size of the folder/if he got folders in him). And after coming back in, "his father folder" and continue to give me the same information. BUT ! If the "father folder" has a second child, he gives me the second child information first."
This will depend on your implementation but you have to recursively get the children of a folder type file. As stated in this related SO post,"stop thinking about Drive as being a tree structure. It isn't. "Folders" are simply labels, eg. a file can have multiple parents."
After getting the desire fileID with your specific qualifications, get the details using file.get or include the details you want to get in file.list.
Hope this helps.

Is it possible to know the folder content? OneDrive

I wanna try OneDrive Api for Android and I was taking a look at the methods and possibilities this Api offers on this link and this other one but I don't see any way of listing the files a folder contains.
My App would need to upload some files to OneDrive, always using the same folder as root, say /MyFolder. The problem is that it only knows this root folder and all its content must be found out by means of recursive calls, that is, I list the files contained in /MyFolder and check if it's a folder or a file and in the first case list the files again it contains and so on.
Am I missing something or this Api doesn't provide such thing?
The Json object returned for a query against a Folder should contain a "data" property that is an array of children for the folder. You can see this in the interactive SDK (http://isdk.dev.live.com/dev/isdk/default.aspx) by playing with the "Reading Folder Properties" API.

Office 365 MyFiles API - How to get the direct children in the root of the One Drive folder

I'm trying to work with the new summer release of the Office 365 API tool for Visual Studio 2013 (update 3). It works fine except one problem I've encountered which can be called also a missing functionality.
I found no reasonable way to retrieve the direct children of the root folder from my One Drive for business Document Library using the newly added SharePointClient library.
The API call of SharePointClient.Files will retrieve all the files and folders from the whole document library including sub-folders. So in order to get only the direct children I have to page through all the documents and folders and analyze their URL. This is not acceptable for my application scenario. For a sub-folder I can get the direct children like this: SharePointClient.Files["<folder_id>"].ToFolder().Children This is what I need but it can't be applied to the root folder.
I've tried to use the REST API directly and similarly the request GET ../_api/files will retrieve all files and folders in the default document library and I found no simple way to list only the direct children of the root. Also there is no convenient way to get the path or GUID of the default document library which the SharePointClient.Files automatically uses.
Parsing the result XMLs of the REST API calls I may get the GUID of the default document library, that will let me use a different REST API to list files and folders separately for the root folder, but these calls results in a different XML schema from that used by SharePointClient. This means that to get only the direct children of the root I would have to re-implement the whole SharePointClient library.
If anybody has some good advice I'll be very thankful.
I just ran into the same issue - hopefully this will be remedied before the release version of the api tools. Here is what I've done to get only the root folder content:
[Create your spClient = SharePointClient]
var allFiles = await spClient.Files.ExecuteAsync();
var rootFiles = allFiles.CurrentPage.Where(i => !i.Id.Contains("/"));
You lose the IPagedCollection wrapper and you may need to get more than the 'CurrentPage' to see all files but this is the best workaround I've found. I'm then able to you the 'ToFolder()' method you mentioned above to list content of sub-folders.