简体   繁体   中英

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

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM