首页 > 解决方案 > etherpad lite api 列表全部失败

问题描述

在 etherpad lite 中,我尝试使用 api 列出垫或组。但我收到以下消息:

{"code":2,"message":"createHTTPError.notFound is not a constructor","data":null}

我已经编写了一个 Java 应用程序,并且我尝试过使用 curl。

卷曲:

 curl "http://localhost:9001/api/1/listAllPads&apikey=477da...

"code":2,"message":"createHTTPError.notFound is not a constructor","data":null}

curl "http://localhost:9001/api/1/listAllGroups?apikey=477da3361...

{"code":2,"message":"createHTTPError.notFound is not a constructor","data":null}

使用 api 为组和会话创建作者、组、pad。

环境:

视窗 10

Node.js v12.17.0

无代理,直接访问

数据库 postgres

Etherpad版本版本号:1.8.4

Git sha: 6a0f73d

已安装的插件

ep_auth_session、ep_adminpads2、ep_etherpad-lite、ep_message_all、ep_headings2、ep_real_time_chat、ep_tables3、ep_author_hover

标签: apietherpad

解决方案


调用不受支持的函数时出现错误“createHTTPError.notFound is not a constructor”。您指定的api版本(1)仅支持以下功能

 { "createGroup"               : []
  , "createGroupIfNotExistsFor" : ["groupMapper"]
  , "deleteGroup"               : ["groupID"]
  , "listPads"                  : ["groupID"]
  , "createPad"                 : ["padID", "text"]
  , "createGroupPad"            : ["groupID", "padName", "text"]
  , "createAuthor"              : ["name"]
  , "createAuthorIfNotExistsFor": ["authorMapper" , "name"]
  , "listPadsOfAuthor"          : ["authorID"]
  , "createSession"             : ["groupID", "authorID", "validUntil"]
  , "deleteSession"             : ["sessionID"]
  , "getSessionInfo"            : ["sessionID"]
  , "listSessionsOfGroup"       : ["groupID"]
  , "listSessionsOfAuthor"      : ["authorID"]
  , "getText"                   : ["padID", "rev"]
  , "setText"                   : ["padID", "text"]
  , "getHTML"                   : ["padID", "rev"]
  , "setHTML"                   : ["padID", "html"]
  , "getRevisionsCount"         : ["padID"]
  , "getLastEdited"             : ["padID"]
  , "deletePad"                 : ["padID"]
  , "getReadOnlyID"             : ["padID"]
  , "setPublicStatus"           : ["padID", "publicStatus"]
  , "getPublicStatus"           : ["padID"]
  , "listAuthorsOfPad"          : ["padID"]
  , "padUsersCount"             : ["padID"]

API 版本 1.1 和 1.2.1 支持您请求的功能。

在这里,您可以使用各自的 API 版本查看完整的函数列表 https://github.com/ether/etherpad-lite/blob/develop/src/node/handler/APIHandler.js

解决方案:使用 api 版本 1.2.1(支持 listAllGroups 和 listAllPads)

curl "http://localhost:9001/api/1.2.1/listAllPads&apikey=477da...


推荐阅读