简体   繁体   English

使用 Quip API,您如何获得所有线程的列表?

[英]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.我需要使用 Quip API 获取我公司中所有公开可见的 Quip 文档的列表。 I have a service worker account that will make the API calls.我有一个可以进行 API 调用的服务工作者帐户。

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. Quip 的 API 文档告诉您如何使用Get Folders通过传入文件夹 ID 来获取有关一个或多个文件夹的信息。 You can call this again for nested folders, and you can call Get Threads to get information about each document.您可以为嵌套文件夹再次调用此方法,并且可以调用Get Threads以获取有关每个文档的信息。 (Quip uses the terminology "threads," not "documents.") (Quip 使用术语“线程”,而不是“文档”。)

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 ."获取文件夹文档说“要查找您的桌面或存档文件夹 ID,请参阅获取经过身份验证的用户” I've tried that but it returns folders called Desktop, Archive, Starred, Private, Shared, and Group.我已经尝试过,但它返回名为 Desktop、Archive、Starred、Private、Shared 和 Group 的文件夹。

  • Desktop seemed like a good place to start but its only child is Archive, and... Desktop似乎是一个不错的起点,但它唯一的孩子是存档,而且...
  • Archive only contains a couple dozen docs. Archive仅包含几十个文档。 The meaning of the Archive folder is not documented. Archive 文件夹的含义没有记录。
  • Starred is docs you've favorited. Starred是您收藏的文档。
  • Private is your private docs. Private是您的私人文档。
  • Shared is docs that have been shared with you. Shared是已与您Shared的文档。
  • Group seemed promising because the Folders UI at quip.com/browse shows the word "Group Folders" at the top. Group看起来很有希望,因为 quip.com/browse 上的文件夹 UI 在顶部显示了“Group Folders”这个词。 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:这有点晚了,但由于 QUIP API 维护不善且没有很好的文档记录,对于那些希望解决相同问题的人,这里有一种方法:

Step 1: Add your company's root folder to your favorite (Starred folder), and drag it to the top of the favorite list.第1步:将您公司的根文件夹添加到您的收藏夹(Starred文件夹),并将其拖到收藏夹列表的顶部。

Step 2: Get you authenticated instance:第 2 步:获取经过身份验证的实例:

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.您将检索带有基本信息的 json 结果,例如名称、ID...以及最重要的用户的starred_folder_id

Step 3: Pass the starred_folder_id to the get_folder method:第 3 步:starred_folder_id传递给get_folder方法:

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.您将收到另一个带有名为children的键的 json,其中包含您已加星标的文件夹/文件的值,这些值按照它在您的quip应用程序中出现的顺序排列。 The first folder_id will be your company folder id.第一个folder_id将是您的公司文件夹 ID。

You can now use the folder_id to retrieve the rest of your company documents by more get_folder .您现在可以使用folder_id通过 more get_folder检索公司文档的其余部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何获得所有酒单API? - How can i get all wine list api? 如何使用RBAC API获取所有角色分配的列表 - How to get list of all roles assignments using RBAC API 如何使用openfire rest API获取特定用户是参与者或所有者的所有MUC ROOM的列表 - How can I get list of all MUC ROOMs in which particular user is participant or owner using openfire rest API 您在哪里可以获得用户有权访问的所有Basecamp的列表? - Where can you get list of all Basecamps that user has access to? 如何在列表Twitter API中获取所有用户? - How to get all users in a list Twitter API? 我们可以使用rest api获取SharePoint列表中的所有私有视图吗 - Can we get all of the private views in a SharePoint list using rest api Quip是否具有文档搜索API? - Does Quip have a document search API? Call Of Duty API - 如何仅通过输入用户名获取所有用户平台的列表? - Call Of Duty API - How can I get a list of all user platforms by entering username only? 如何使用 Unsplash API 获取所有特定用户照片的列表? - How to get a list of all a specific user's photos using Unsplash API? 您可以使用API​​在Facebook上获得“喜欢”的网址/来源吗? - Can you get the url/source for a 'like' on Facebook using the API's?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM