Skip to main content
POST
/
v1
/
sql
/
translate
Translate SQL
curl --request POST \
  --url https://api.withsplendor.com/v1/sql/translate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-splendor-tenant-id: <x-splendor-tenant-id>' \
  --data '
{
  "cursor": "<string>",
  "dataset_scope": "selected",
  "datasets": [
    "<string>"
  ],
  "limit": 100,
  "sql": "<string>",
  "view_id": "<string>"
}
'
{
  "aggregations": [],
  "dsl": {
    "max_hits": 20,
    "query": {
      "term": {
        "status": "error"
      }
    }
  },
  "group_by_fields": [],
  "is_aggregation": false,
  "limit_source": "sql",
  "selected_fields": [
    {
      "logical": "status",
      "physical": "status_keyword",
      "type": "keyword"
    }
  ],
  "sort_fields": [],
  "used_fields": [
    {
      "logical": "status",
      "physical": "status_keyword",
      "type": "keyword"
    }
  ],
  "warnings": []
}

Authorizations

Authorization
string
header
required

API token issued from the Splendor console.

Headers

x-splendor-tenant-id
string
required

Selects the tenant (workspace) the request acts within.

Body

application/json
cursor
string | null
Minimum string length: 1
dataset_scope
enum<string>
default:selected
Available options:
selected,
all
datasets
string[]
limit
integer
default:100
Required range: 0 <= x <= 1000
sql
string | null
Minimum string length: 1
view_id
string | null
Minimum string length: 1

Response

Successful Response

dsl
Dsl · object
required
limit_source
enum<string>
required
Available options:
default,
sql
aggregations
string[]
group_by_fields
SqlFieldReference · object[]
is_aggregation
boolean
default:false
selected_fields
SqlFieldReference · object[]
sort_fields
SqlFieldReference · object[]
used_fields
SqlFieldReference · object[]
warnings
string[]