api - 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
解决方案
调用不受支持的函数时出现错误“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...
推荐阅读
- android - 如何将服务器图像 url 转换为 Drawable Int
- cmd - 有没有办法在 Windows 命令提示符下以秒为单位获取当前时间?
- r - 如何删除警告:Rcpp/DataFrame.h:136:18: 警告未使用的变量“数据”?
- python - TypeError:一元+的错误操作数类型:'str'当我认为代码正确时
- spring-boot - 当消费者的处理时间超过 max.poll.interval.ms 时,消费者没有下线
- python - 我想在 profile.html 模板-django 中显示注册人的详细信息,例如(名字、电子邮件、电话号码)
- json - 如何修复“预计解码字典
但找到了一个数组。”,基础错误:无 - laravel - SQLSTATE[HY000]: 一般错误: 2031 (SQL: select * from `work_permits` where `user_id` = ?) 使用 laravel
- plotly - 如何创建子图并使用破折号回调进行更新
- julia - 在 Julia 语言的代码括号示例中看到的 `julia>` 是什么意思?