Calls a custom API handler defined on the database with DEFINE API.
Method Syntax
client.api(path, method, session, txn)Arguments
Argument | Description |
|---|---|
path | The API path to call. |
method | The HTTP method. Defaults to "GET". |
session | An optional session id. |
txn | An optional transaction id. |
Example usage
var resp = client.api("/users", "GET")Note
The API endpoint is checked against the active transport's capabilities. If the transport does not support it, the SDK raises an UnsupportedFeatureError.