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.
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());
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.
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());
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.
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());
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());