In addition to the SQL Drivers you can also have access to our SQL Drivers using an API endpoint. Using the SlicingDice SQL this way you don't need to worry on installing any driver on your machine.
Watch this quick video below to learn more about the SlicingDice's API-based SQL endpoint.
To use the API-based SQL you need to make requests to a specific endpoint on SlicingDice, the
https://api.slicingdice.com/v1/sql endpoint. This endpoint only receives POST requests and have these required parameters:
Authorization: Your Database Key received when a new database was created or a demo Database Key;
Content-Type: The Content-Type should be application/sql.
To use the endpoint you simply need to make a request sending the required parameters showed above and a SQL statement on the body of the request. Below you can find some examples.
Inserting one value to a string column (
state) to one entity (
$ curl -X POST https://api.slicingdice.com/v1/sql \ -H 'Authorization: MASTER_OR_WRITE_API_KEY' \ -H 'Content-Type: application/sql' \ -d 'INSERT INTO default ([entity-id], state) VALUES ("Entity1", "CA");'
$ curl -X POST https://api.slicingdice.com/v1/sql \ -H 'Authorization: MASTER_OR_WRITE_API_KEY' \ -H 'Content-Type: application/sql' \ -d 'SELECT COUNT([entity-id]) FROM users WHERE state = 'CA';'