Credentials

Support DQE
Support DQE
  • Updated
Credentials - DQE One Standalone API

Create, inspect and delete the connections DQE One Standalone uses to reach your data: Salesforce, Microsoft Dynamics 365, PostgreSQL, Snowflake, BigQuery and SFTP.

{DOMAIN} is the host name of your own DQE One Standalone server — it is self-hosted, so this value depends on your deployment. {EMAIL} is your DQE One login and {API_TOKEN} the token generated in My Account > API Token.
Secrets: the API never returns a password, key or token. getCredential only exposes the login. Creating a credential sends secrets over the wire: always use HTTPS and avoid pasting real secrets into shared tools.
Create a credential - DQE One Standalone API

Creates a connection. For most types DQE One tests the connection first, so a credential that cannot connect is never saved.

createCredential

Request

Send a JSON body. The keys you must provide depend on type (table below).

POSThttps://{DOMAIN}/api/Cred/create

Code examples

Create a credential

curl -u "{EMAIL}:{API_TOKEN}" -X POST \ -H "Content-Type: application/json" \ -d '{ "type": "postgres", "endpoint": "db.acme.com", "port": 5432, "login": "dqe", "password": "s3cret", "database": "crm" }' \ "https://{DOMAIN}/api/Cred/create"
fetch("https://{DOMAIN}/api/Cred/create", { method: "POST", headers: { "Authorization": "Basic " + btoa("{EMAIL}:{API_TOKEN}"), "Content-Type": "application/json" }, body: JSON.stringify({ "type": "postgres", "endpoint": "db.acme.com", "port": 5432, "login": "dqe", "password": "s3cret", "database": "crm" }) }) .then(r => r.text()) .then(data => console.log(data));
import requests response = requests.post( "https://{DOMAIN}/api/Cred/create", auth=("{EMAIL}", "{API_TOKEN}"), json={"type": "postgres", "endpoint": "db.acme.com", "port": 5432, "login": "dqe", "password": "s3cret", "database": "crm"}, ) print(response.status_code, response.text)
<?php $ch = curl_init("https://{DOMAIN}/api/Cred/create"); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_USERPWD, "{EMAIL}:{API_TOKEN}"); $data = ['type' => 'postgres', 'endpoint' => 'db.acme.com', 'port' => 5432, 'login' => 'dqe', 'password' => 's3cret', 'database' => 'crm']; curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); echo $status . " " . $response;
const axios = require('axios'); axios({ method: "post", url: "https://{DOMAIN}/api/Cred/create", auth: { username: "{EMAIL}", password: "{API_TOKEN}" }, data: { "type": "postgres", "endpoint": "db.acme.com", "port": 5432, "login": "dqe", "password": "s3cret", "database": "crm" } }) .then(res => console.log(res.status, res.data)) .catch(err => console.log(err.response ? err.response.status : err.message, err.response && err.response.data));
import java.net.URI; import java.net.http.*; import java.util.Base64; String auth = Base64.getEncoder().encodeToString("{EMAIL}:{API_TOKEN}".getBytes()); String body = "{\"type\":\"postgres\",\"endpoint\":\"db.acme.com\",\"port\":5432,\"login\":\"dqe\",\"password\":\"s3cret\",\"database\":\"crm\"}"; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://{DOMAIN}/api/Cred/create")) .header("Authorization", "Basic " + auth) .header("Content-Type", "application/json") .method("POST", HttpRequest.BodyPublishers.ofString(body)) .build(); HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.statusCode() + " " + response.body());
using System.Net.Http; using System.Net.Http.Headers; using System.Text; using var client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue( "Basic", Convert.ToBase64String(Encoding.UTF8.GetBytes("{EMAIL}:{API_TOKEN}"))); using var request = new HttpRequestMessage(HttpMethod.Post, "https://{DOMAIN}/api/Cred/create"); request.Content = new StringContent("{\"type\":\"postgres\",\"endpoint\":\"db.acme.com\",\"port\":5432,\"login\":\"dqe\",\"password\":\"s3cret\",\"database\":\"crm\"}", Encoding.UTF8, "application/json"); var response = await client.SendAsync(request); Console.WriteLine((int)response.StatusCode + " " + await response.Content.ReadAsStringAsync());
package main import ( "bytes" "fmt" "io" "net/http" ) func main() { body := []byte(`{"type":"postgres","endpoint":"db.acme.com","port":5432,"login":"dqe","password":"s3cret","database":"crm"}`) req, _ := http.NewRequest("POST", "https://{DOMAIN}/api/Cred/create", bytes.NewBuffer(body)) req.SetBasicAuth("{EMAIL}", "{API_TOKEN}") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(resp.StatusCode, string(out)) }

Parameters

Field Description Type Mand / Opt
type
Values: salesforce
String Mandatory
login Salesforce username (JWT bearer flow). String Mandatory
endpoint Instance URL, e.g. https://acme.my.salesforce.com. A trailing '/' is removed. String Mandatory
client_id Consumer key of the connected app. String Mandatory
pvt PEM private key matching the connected app certificate. String Mandatory
Authentication: HTTP Basic — your DQE One email and your API token (My Account > API Token). See the Introduction article.

Required keys, per type

type Required keys Notes
salesforce login, endpoint, client_id, pvt JWT bearer flow: endpoint is the instance URL (a trailing / is removed), pvt the PEM private key of the connected app certificate.
dynamics client_id, client_secret, scope, tenant Needs a browser OAuth login — answers pending (see below).
snowflake endpoint, client_id, client_secret Needs a browser OAuth login — answers pending. Processes on Snowflake currently fail validation.
postgres endpoint, port, login, password, database endpoint is the host name.
sftp endpoint, port, login, password Optional pvt = private key; password is then the key passphrase. The host must be in the server's AUTHORIZED_SFTP_HOSTS list (exact match).
bigquery login, email, id, key_id, pvt Service account: login = client id, email = client email, id = project id, key_id and pvt = private key id and key.

Dynamics and Snowflake: the pending response

These two types need an OAuth login in a browser. The API stores your settings for 5 minutes and answers HTTP 201 with {"status":"pending","url":"https://{DOMAIN}/login/?token=..."}. A person must open that URL and sign in; there is no API call to finish it. Poll listCredentials until the credential appears.

About name

A name key is accepted but ignored: the label is derived from the connection — Salesforce “<org name> (<org id>)”, PostgreSQL and SFTP the host, BigQuery the project id.

Response

Created (or pending OAuth). HTTP status 201.

Key Description Type
status
Values: success
String
id Integer

Response example

Example response
{ "status": "success", "id": 3 }

Errors

HTTP Body / meaning
400 Keys endpoint,port need to be set for type postgres
401 Unauthorized
500 Failed to create credentials.

A failed connection test (wrong password, unreachable or unauthorised host, bad key) is always reported as the same generic Failed to create credentials. (HTTP 500). Check the host, port and secrets, and for SFTP that the host is allowed on the server.

Test the API

Click the button below to test this endpoint live in your browser.

Heads-up: this console sends a real request to your own server from your browser, with your real API token. Creating a credential tests a real connection to your data source.
Open console
List credentials - DQE One Standalone API

Lists the id and label of your credentials.

listCredentials

Request

Send a GET request. There are no parameters.

GEThttps://{DOMAIN}/api/Cred/list

Code examples

List your credentials

curl -u "{EMAIL}:{API_TOKEN}" \ "https://{DOMAIN}/api/Cred/list"
fetch("https://{DOMAIN}/api/Cred/list", { method: "GET", headers: { "Authorization": "Basic " + btoa("{EMAIL}:{API_TOKEN}") } }) .then(r => r.text()) .then(data => console.log(data));
import requests response = requests.get( "https://{DOMAIN}/api/Cred/list", auth=("{EMAIL}", "{API_TOKEN}"), ) print(response.status_code, response.text)
<?php $ch = curl_init("https://{DOMAIN}/api/Cred/list"); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET"); curl_setopt($ch, CURLOPT_USERPWD, "{EMAIL}:{API_TOKEN}"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); echo $status . " " . $response;
const axios = require('axios'); axios({ method: "get", url: "https://{DOMAIN}/api/Cred/list", auth: { username: "{EMAIL}", password: "{API_TOKEN}" } }) .then(res => console.log(res.status, res.data)) .catch(err => console.log(err.response ? err.response.status : err.message, err.response && err.response.data));
import java.net.URI; import java.net.http.*; import java.util.Base64; String auth = Base64.getEncoder().encodeToString("{EMAIL}:{API_TOKEN}".getBytes()); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://{DOMAIN}/api/Cred/list")) .header("Authorization", "Basic " + auth) .method("GET", HttpRequest.BodyPublishers.noBody()) .build(); HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.statusCode() + " " + response.body());
using System.Net.Http; using System.Net.Http.Headers; using System.Text; using var client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue( "Basic", Convert.ToBase64String(Encoding.UTF8.GetBytes("{EMAIL}:{API_TOKEN}"))); using var request = new HttpRequestMessage(HttpMethod.Get, "https://{DOMAIN}/api/Cred/list"); var response = await client.SendAsync(request); Console.WriteLine((int)response.StatusCode + " " + await response.Content.ReadAsStringAsync());
package main import ( "fmt" "io" "net/http" ) func main() { req, _ := http.NewRequest("GET", "https://{DOMAIN}/api/Cred/list", nil) req.SetBasicAuth("{EMAIL}", "{API_TOKEN}") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(resp.StatusCode, string(out)) }

Parameters

This endpoint takes no parameters.

Authentication: HTTP Basic — your DQE One email and your API token (My Account > API Token). See the Introduction article.

Response

Array of credentials. HTTP status 200.

The body is a JSON array; each element has these keys.

Key Description Type
id Integer
name Label derived from the connection (see the Credentials article). String

Response example

Example response
[ { "id": 3, "name": "db.acme.com" } ]

Errors

HTTP Body / meaning
401 Unauthorized

Test the API

Click the button below to test this endpoint live in your browser.

Heads-up: this console sends a real request to your own server from your browser, with your real API token.
Open console
Get a credential - DQE One Standalone API

Returns the metadata of one credential and whether it still connects.

getCredential

Request

Send a GET request with the credential id.

Live test on every call: status is computed by actually connecting to the data source each time (valid if it connects, expired otherwise), so this call can be slow. login is the decrypted login; for types that have no login it is the client_id.
GEThttps://{DOMAIN}/api/Cred/get?id={id}

Code examples

Get a credential

curl -u "{EMAIL}:{API_TOKEN}" \ "https://{DOMAIN}/api/Cred/get?id=3"
fetch("https://{DOMAIN}/api/Cred/get?id=3", { method: "GET", headers: { "Authorization": "Basic " + btoa("{EMAIL}:{API_TOKEN}") } }) .then(r => r.text()) .then(data => console.log(data));
import requests response = requests.get( "https://{DOMAIN}/api/Cred/get", auth=("{EMAIL}", "{API_TOKEN}"), params={"id": "3"}, ) print(response.status_code, response.text)
<?php $ch = curl_init("https://{DOMAIN}/api/Cred/get?id=3"); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET"); curl_setopt($ch, CURLOPT_USERPWD, "{EMAIL}:{API_TOKEN}"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); echo $status . " " . $response;
const axios = require('axios'); axios({ method: "get", url: "https://{DOMAIN}/api/Cred/get", auth: { username: "{EMAIL}", password: "{API_TOKEN}" }, params: { "id": "3" } }) .then(res => console.log(res.status, res.data)) .catch(err => console.log(err.response ? err.response.status : err.message, err.response && err.response.data));
import java.net.URI; import java.net.http.*; import java.util.Base64; String auth = Base64.getEncoder().encodeToString("{EMAIL}:{API_TOKEN}".getBytes()); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://{DOMAIN}/api/Cred/get?id=3")) .header("Authorization", "Basic " + auth) .method("GET", HttpRequest.BodyPublishers.noBody()) .build(); HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.statusCode() + " " + response.body());
using System.Net.Http; using System.Net.Http.Headers; using System.Text; using var client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue( "Basic", Convert.ToBase64String(Encoding.UTF8.GetBytes("{EMAIL}:{API_TOKEN}"))); using var request = new HttpRequestMessage(HttpMethod.Get, "https://{DOMAIN}/api/Cred/get?id=3"); var response = await client.SendAsync(request); Console.WriteLine((int)response.StatusCode + " " + await response.Content.ReadAsStringAsync());
package main import ( "fmt" "io" "net/http" ) func main() { req, _ := http.NewRequest("GET", "https://{DOMAIN}/api/Cred/get?id=3", nil) req.SetBasicAuth("{EMAIL}", "{API_TOKEN}") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(resp.StatusCode, string(out)) }

Parameters

Field Description Type Mand / Opt
id Credential id. Integer Mandatory
Authentication: HTTP Basic — your DQE One email and your API token (My Account > API Token). See the Introduction article.

Response

Credential. HTTP status 200.

Key Description Type
id Integer
login Decrypted login (client_id for types that have no login). Passwords, keys and tokens are never returned. String
name String
type
Values: salesforce, dynamics, snowflake, postgres, sftp, bigquery
String
status Result of a LIVE connection test run on every call.
Values: valid, expired
String
process Ids of the processes using this credential. Array

Response example

Example response
{ "id": 3, "login": "dqe", "name": "db.acme.com", "type": "postgres", "status": "valid", "process": [ 42 ] }

Errors

HTTP Body / meaning
400 No id found.
401 Unauthorized
404 Credential not found

Test the API

Click the button below to test this endpoint live in your browser.

Heads-up: this console sends a real request to your own server from your browser, with your real API token.
Open console
Delete a credential - DQE One Standalone API

Deletes a credential. Refused with 423 while any process uses it.

deleteCredential

Request

Send a DELETE request with the credential id. A non-numeric id produces an unformatted HTTP 500.

DELETEhttps://{DOMAIN}/api/Cred/delete?id={id}

Code examples

Delete a credential

curl -u "{EMAIL}:{API_TOKEN}" -X DELETE \ "https://{DOMAIN}/api/Cred/delete?id=3"
fetch("https://{DOMAIN}/api/Cred/delete?id=3", { method: "DELETE", headers: { "Authorization": "Basic " + btoa("{EMAIL}:{API_TOKEN}") } }) .then(r => r.text()) .then(data => console.log(data));
import requests response = requests.delete( "https://{DOMAIN}/api/Cred/delete", auth=("{EMAIL}", "{API_TOKEN}"), params={"id": "3"}, ) print(response.status_code, response.text)
<?php $ch = curl_init("https://{DOMAIN}/api/Cred/delete?id=3"); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); curl_setopt($ch, CURLOPT_USERPWD, "{EMAIL}:{API_TOKEN}"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); echo $status . " " . $response;
const axios = require('axios'); axios({ method: "delete", url: "https://{DOMAIN}/api/Cred/delete", auth: { username: "{EMAIL}", password: "{API_TOKEN}" }, params: { "id": "3" } }) .then(res => console.log(res.status, res.data)) .catch(err => console.log(err.response ? err.response.status : err.message, err.response && err.response.data));
import java.net.URI; import java.net.http.*; import java.util.Base64; String auth = Base64.getEncoder().encodeToString("{EMAIL}:{API_TOKEN}".getBytes()); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://{DOMAIN}/api/Cred/delete?id=3")) .header("Authorization", "Basic " + auth) .method("DELETE", HttpRequest.BodyPublishers.noBody()) .build(); HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.statusCode() + " " + response.body());
using System.Net.Http; using System.Net.Http.Headers; using System.Text; using var client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue( "Basic", Convert.ToBase64String(Encoding.UTF8.GetBytes("{EMAIL}:{API_TOKEN}"))); using var request = new HttpRequestMessage(HttpMethod.Delete, "https://{DOMAIN}/api/Cred/delete?id=3"); var response = await client.SendAsync(request); Console.WriteLine((int)response.StatusCode + " " + await response.Content.ReadAsStringAsync());
package main import ( "fmt" "io" "net/http" ) func main() { req, _ := http.NewRequest("DELETE", "https://{DOMAIN}/api/Cred/delete?id=3", nil) req.SetBasicAuth("{EMAIL}", "{API_TOKEN}") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(resp.StatusCode, string(out)) }

Parameters

Field Description Type Mand / Opt
id Credential id. Integer Mandatory
Authentication: HTTP Basic — your DQE One email and your API token (My Account > API Token). See the Introduction article.

Response

Deleted. HTTP status 200.

Key Description Type
status
Values: success
String

Response example

Example response
{ "status": "success" }

Errors

HTTP Body / meaning
400 No id found.
401 Unauthorized
404 Credential not found
423 Credential is used in one or more processes and cannot be deleted
500 Failed to delete the Credential

Test the API

Click the button below to test this endpoint live in your browser.

Heads-up: this console sends a real request to your own server from your browser, with your real API token. This permanently deletes the credential.
Open console

See also

Related to

Was this article helpful?

0 out of 0 found this helpful