JavaScript client¶
The SeaTable JavaScript client encapsulates SeaTable Server Restful API. You can call it in your front-end page or Node.js program.
Two different clients
JavaScript API cannot be used for scripts in SeaTable bases. For script programming with JavaScript, there is a separate chapter in this documentation.
Note that JavaScript API calls SeaTable Server Restful API, whereas scripts in SeaTable bases interact with the base loaded in the browser, so the APIs of the two are somewhat different.
Installation¶
The source code of the JavaScript Client API is available at GitHub.
Reference¶
To use SeaTable APIs, you should first initialize a base object and call base.auth(). base.auth() is an async function, which needs to be executed in async functions. Other APIs all return a promise object. There are two ways to use them:
Here are the main SeaTable API errors you might encounter:
- 400 Params invalid
- 403 Permission denied
- 413 Exceed limit (see the API Reference about limits)
- 500 Internal Server Error
Authorization¶
The Base object represents a table. You need to specify an APIToken to get access authorization and to be able to read and write the base. API tokens can be directly generated in the web interface.
Example