curl.
The HTTP Query API returns data in JSON format by default. The default header value is Accept: application/json.
API Documentation
The API follows OpenAPI Specification (Swagger®) guidelines, which you can access in these formats from any SQL Node address{sql_node_address}:
- YAML format:
/openapi.yamlendpoint - JSON format:
/openapi.jsonendpoint
CURL
CURL
Connection Setup
The connectivity pool defines connection settings for SQL Nodes, including their open port and address. For details, see CONNECTIVITY POOL. A standard production install enables the OpenAPI port by default. At bootstrap, the system creates a defaultsystem connectivity pool and sets the openapi_port value of each participant to 443 + node port offset. This setting mirrors the offset that the SQL port (4050) and REST port (9090) already apply. You do not need to configure anything to reach the HTTP Query API or web UI on a fresh cluster.
All the examples assume that the
openapi_port is the standard SSL port 443. If your connectivity pool openapi_port has a different port setting, you must specify it in the request URL. For example, this URL specifies using port 8443: https://sql_node_address:8443/v1/execute/.443 is a privileged port, the system applies this default value only when the rolehostd process runs as root or has the CAP_NET_BIND_SERVICE capability. Otherwise, the openapi_port remains unset, and you must configure it manually using this SQL statement.
Enable or Change the OpenAPI Port
To open a port on a participant that does not already have one, or to change the port from its default, execute this ALTER CONNECTIVITY POOL SQL statement. Change the connectivity pool and node values in the example according to your system.
SQL
Check Port Configuration
Verify your port configuration by executing this query.SQL
SSL Certificate Setup
The Ocient® HTTP Query API supports two options for handling SSL certificates. Secure Connection Using TLS You can use your own certificates for TLS-secured connections by configuring certificate files in your Ocient install. For details, see Secure Connections Using TLS. Unsecured Connection For quick testing or in non-production environments, you can bypass certificate validation by adding the-k or --insecure flag to your curl command.
Example
SQL
Authentication Methods
The Ocient HTTP Query API accepts user credentials in various formats designed for different use cases. Simple API Requests For simple queries, you can include user credentials in the request. In this example, the request includes credentials after the-u flag.
CURL
login endpoint. Replace the text in this example with the address of your SQL Node, your username, your password, and the name of your database.
CURL
CURL
sso_authentication endpoint with a callback path. Replace the text in this example with the name of your instance, the name of your database, and your callback path.
CURL
CURL
API Endpoint Documentation
The Ocient HTTP Query API supports these endpoints. For API requests, JSON data must use double quotes (") for all keys and string values. Single quotes should enclose the JSON payload, as shown in this example (see the payload section following the -d flag).
CURL

