apietherpad

etherpad lite api listAll failed


In etherpad lite I try to list pads or groups with the api. But I reveive the following message:

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

I've writen an Java-Application doing and I've tried with curl.

With 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}

Createing author, group, pad for group and session works with the api.

Enviroment:

Windows 10

Node.js v12.17.0

No proxy, direct access

Database postgres

Etherpad version Version number: 1.8.4

Git sha: 6a0f73d

Installed plugins

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


Solution

  • The error "createHTTPError.notFound is not a constructor" occurred when an unsupported function is called. The api version (1) that you have specified supports following functions only

     { "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"]
    

    The functions, you are requesting are supported by API version 1.1 and 1.2.1.

    Here, you can check complete list of functions with their respective API version https://github.com/ether/etherpad-lite/blob/develop/src/node/handler/APIHandler.js

    Solution: Use the api version 1.2.1 (It supports listAllGroups and listAllPads)

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