Important
Self-managed SingleStore will soon transition from version 9.1 RC to version 10. This new semantic versioning scheme will provide SingleStore with finer control over engine and feature releases that were not possible with the current versioning scheme.
In the interim, SingleStore 9.1 RC can be used to preview, evaluate, and provide feedback on the new and upcoming features in SingleStore 10 prior to its general availability. Ahead of this transition, SingleStore 9.0 is recommended for production workloads, which can later be upgraded to SingleStore 10.
Access the Data API
Data API can be accessed using Basic and Bearer Authentication methods at protocol://hostname:port/api/version/ where:
-
protocolis HTTPS/HTTP; protocol must be HTTPS when SSL is enabled. -
hostnamerepresents the IP address or hostname of the SingleStore deployment. -
portis the secure WebSocket proxy port configured. -
versionis the Data API version; currently v1 and v2 are supported.
To access SingleStore Data API via Basic Authentication, you need to provide your SingleStore account credentials (username and password) in each HTTP request.username:password string in the Authorization header in the HTTP client.demo:Afu4XjzB1ns appears as follows.
Authorization: Basic ZGVtbzpBZnU0WGp6QjFucw==
Using an HTTP client such as cURL, you can either pass your credentials as parameters in the --user or the -u option or add them before the hostname in the HTTP request, as shown below.
curl -u "username:password" https://hostname:port/api/v2/exec
curl https://username:password@hostname:port/api/v2/exec
cURL encodes the username:password string using Base-64 and inserts it in the Authorization header before sending the HTTP request to the server.
Here's an example of using Bearer Authentication to access the Data API via cURL:
curl -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.C1um3oUNP4178sTG9WahtfZxN0-GqnYTPsbx-zhH9Qk" https://hostname:port/api/v2/exec
You can use API development tools and libraries to send Data API requests and handle responses.
Last modified: