Enable the Data API
On this page
SingleStore’s Data API is accessible via a built-in HTTP server.
Test the Data API
Call the GET /ping
API request to verify that the HTTP service is running and connectable.GET
request to the /ping
endpoint with no parameters:
curl https://svc-XXXX-dml.aws-ireland-1.svc.singlestore.com/ping
If the Data API service is available and is able to respond to requests, you will receive the following response along with a 200 OK status code, indicating a successful HTTP response.
ping
If an error occurs, you will receive one of the HTTP response status codes, along with the error description in the response body.
The GET /ping
request can only verify whether the HTTP service is running and connectable./exec
and /query
endpoints.
The following cURL command makes a POST
API request to the /query/rows
endpoint.root:password
in the HTTP request with your SingleStore username:password
string.
curl -H "Content-Type: application/json" --data '{"sql": "select 1+1"}' --user 'root:password' https://svc-XXXX-dml.aws-ireland-1.svc.singlestore.com/api/v2/query/rows
If the API call is successful, you should see the following results along with a 200 OK status code.
{"results":[{"rows":[{"1+1":2}]}]}
If an error occurs, you will receive one of the HTTP response status codes, along with the error description in the response body.
If you format the JSON output with a formatting tool, the results appear as follows.
{"results": [{"rows": [{"1+1": 2}]}]}
Note: The GET /ping
request should be used in automated health checks./exec
and /query
endpoints.
Last modified: July 18, 2024