Verify Connection Before Save
curl --request POST \
--url https://api.example.com/assets/data/verify \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection_type": "postgres",
"credentials": {
"password": "secretpassword",
"username": "dbuser"
},
"database_config": {
"auth_type": "basic",
"database": "analytics",
"db_schema": "public",
"host": "db.example.com",
"port": 5432,
"ssl_mode": "require"
}
}
'import requests
url = "https://api.example.com/assets/data/verify"
payload = {
"connection_type": "postgres",
"credentials": {
"password": "secretpassword",
"username": "dbuser"
},
"database_config": {
"auth_type": "basic",
"database": "analytics",
"db_schema": "public",
"host": "db.example.com",
"port": 5432,
"ssl_mode": "require"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
connection_type: 'postgres',
credentials: {password: 'secretpassword', username: 'dbuser'},
database_config: {
auth_type: 'basic',
database: 'analytics',
db_schema: 'public',
host: 'db.example.com',
port: 5432,
ssl_mode: 'require'
}
})
};
fetch('https://api.example.com/assets/data/verify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/assets/data/verify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'connection_type' => 'postgres',
'credentials' => [
'password' => 'secretpassword',
'username' => 'dbuser'
],
'database_config' => [
'auth_type' => 'basic',
'database' => 'analytics',
'db_schema' => 'public',
'host' => 'db.example.com',
'port' => 5432,
'ssl_mode' => 'require'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/assets/data/verify"
payload := strings.NewReader("{\n \"connection_type\": \"postgres\",\n \"credentials\": {\n \"password\": \"secretpassword\",\n \"username\": \"dbuser\"\n },\n \"database_config\": {\n \"auth_type\": \"basic\",\n \"database\": \"analytics\",\n \"db_schema\": \"public\",\n \"host\": \"db.example.com\",\n \"port\": 5432,\n \"ssl_mode\": \"require\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/assets/data/verify")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connection_type\": \"postgres\",\n \"credentials\": {\n \"password\": \"secretpassword\",\n \"username\": \"dbuser\"\n },\n \"database_config\": {\n \"auth_type\": \"basic\",\n \"database\": \"analytics\",\n \"db_schema\": \"public\",\n \"host\": \"db.example.com\",\n \"port\": 5432,\n \"ssl_mode\": \"require\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/assets/data/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connection_type\": \"postgres\",\n \"credentials\": {\n \"password\": \"secretpassword\",\n \"username\": \"dbuser\"\n },\n \"database_config\": {\n \"auth_type\": \"basic\",\n \"database\": \"analytics\",\n \"db_schema\": \"public\",\n \"host\": \"db.example.com\",\n \"port\": 5432,\n \"ssl_mode\": \"require\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"latency_ms": 123,
"details": {}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}data_connections
Verify Connection Before Save
Verify data connection credentials before creating the connection
POST
/
assets
/
data
/
verify
Verify Connection Before Save
curl --request POST \
--url https://api.example.com/assets/data/verify \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection_type": "postgres",
"credentials": {
"password": "secretpassword",
"username": "dbuser"
},
"database_config": {
"auth_type": "basic",
"database": "analytics",
"db_schema": "public",
"host": "db.example.com",
"port": 5432,
"ssl_mode": "require"
}
}
'import requests
url = "https://api.example.com/assets/data/verify"
payload = {
"connection_type": "postgres",
"credentials": {
"password": "secretpassword",
"username": "dbuser"
},
"database_config": {
"auth_type": "basic",
"database": "analytics",
"db_schema": "public",
"host": "db.example.com",
"port": 5432,
"ssl_mode": "require"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
connection_type: 'postgres',
credentials: {password: 'secretpassword', username: 'dbuser'},
database_config: {
auth_type: 'basic',
database: 'analytics',
db_schema: 'public',
host: 'db.example.com',
port: 5432,
ssl_mode: 'require'
}
})
};
fetch('https://api.example.com/assets/data/verify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/assets/data/verify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'connection_type' => 'postgres',
'credentials' => [
'password' => 'secretpassword',
'username' => 'dbuser'
],
'database_config' => [
'auth_type' => 'basic',
'database' => 'analytics',
'db_schema' => 'public',
'host' => 'db.example.com',
'port' => 5432,
'ssl_mode' => 'require'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/assets/data/verify"
payload := strings.NewReader("{\n \"connection_type\": \"postgres\",\n \"credentials\": {\n \"password\": \"secretpassword\",\n \"username\": \"dbuser\"\n },\n \"database_config\": {\n \"auth_type\": \"basic\",\n \"database\": \"analytics\",\n \"db_schema\": \"public\",\n \"host\": \"db.example.com\",\n \"port\": 5432,\n \"ssl_mode\": \"require\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/assets/data/verify")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connection_type\": \"postgres\",\n \"credentials\": {\n \"password\": \"secretpassword\",\n \"username\": \"dbuser\"\n },\n \"database_config\": {\n \"auth_type\": \"basic\",\n \"database\": \"analytics\",\n \"db_schema\": \"public\",\n \"host\": \"db.example.com\",\n \"port\": 5432,\n \"ssl_mode\": \"require\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/assets/data/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connection_type\": \"postgres\",\n \"credentials\": {\n \"password\": \"secretpassword\",\n \"username\": \"dbuser\"\n },\n \"database_config\": {\n \"auth_type\": \"basic\",\n \"database\": \"analytics\",\n \"db_schema\": \"public\",\n \"host\": \"db.example.com\",\n \"port\": 5432,\n \"ssl_mode\": \"require\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"latency_ms": 123,
"details": {}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
application/json
Request body for verifying a data connection before saving.
This allows testing connection credentials and discovering available tables before actually creating the data connection record.
Data connection types.
Available options:
postgres, redshift, mysql, bigquery, snowflake, databricks, couchbase, oracle, hive, mongodb, s3, gcs, minio, nfs, smb Credentials for the connection. Format depends on connection type and auth_type.
Show child attributes
Show child attributes
Configuration for database connections.
Show child attributes
Show child attributes
Configuration for object storage connections.
Show child attributes
Show child attributes
Configuration for file system connections.
Show child attributes
Show child attributes
Was this page helpful?
⌘I

