Files

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

Upload CSV or Excel files to use as a csv data source, list and delete them, and download the result of a process.

{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.
Good to know: when you create a csv process, the file is cloned and the clone is linked to the process. Your original upload stays free (you can delete it); the clone appears in listFiles with its process_id and cannot be deleted while the process exists.
Upload a file - DQE One Standalone API

Uploads a CSV or Excel file. The returned id is what you pass as file when creating a csv process.

addFile

Request

Send a multipart/form-data POST with one field named file.

Rules: only .csv, .xlsx and .xls (the extension check is case-sensitive, so DATA.CSV is refused). Excel files are converted to CSV (first sheet only) but keep their Excel name. Column headers must be unique and must not contain spaces. Delimiter and quote character are detected automatically. There is no size limit enforced by the API: the whole file is read into memory, so keep uploads reasonable.
POSThttps://{DOMAIN}/api/File/add

Code examples

Upload a file

curl -u "{EMAIL}:{API_TOKEN}" -X POST \ -F "file=@contacts.csv" \ "https://{DOMAIN}/api/File/add"
const form = new FormData(); form.append("file", fileInput.files[0]); // <input type="file"> fetch("https://{DOMAIN}/api/File/add", { method: "POST", headers: { "Authorization": "Basic " + btoa("{EMAIL}:{API_TOKEN}") }, body: form }) .then(r => r.text()) .then(data => console.log(data));
import requests response = requests.post( "https://{DOMAIN}/api/File/add", auth=("{EMAIL}", "{API_TOKEN}"), files={"file": open("contacts.csv", "rb")}, ) print(response.status_code, response.text)
<?php $ch = curl_init("https://{DOMAIN}/api/File/add"); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_USERPWD, "{EMAIL}:{API_TOKEN}"); curl_setopt($ch, CURLOPT_POSTFIELDS, ['file' => new CURLFile("contacts.csv")]); 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'); const FormData = require('form-data'); const fs = require('fs'); const form = new FormData(); form.append('file', fs.createReadStream("contacts.csv")); axios({ method: "post", url: "https://{DOMAIN}/api/File/add", auth: { username: "{EMAIL}", password: "{API_TOKEN}" }, headers: form.getHeaders(), data: form }) .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 boundary = "----dqe" + System.nanoTime(); byte[] content = java.nio.file.Files.readAllBytes(java.nio.file.Path.of("contacts.csv")); var out = new java.io.ByteArrayOutputStream(); out.write(("--" + boundary + "\r\nContent-Disposition: form-data; name=\"file\"; filename=\"" + "contacts.csv" + "\"\r\n\r\n").getBytes()); out.write(content); out.write(("\r\n--" + boundary + "--\r\n").getBytes()); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://{DOMAIN}/api/File/add")) .header("Authorization", "Basic " + auth) .header("Content-Type", "multipart/form-data; boundary=" + boundary) .method("POST", HttpRequest.BodyPublishers.ofByteArray(out.toByteArray())) .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/File/add"); var form = new MultipartFormDataContent(); form.Add(new ByteArrayContent(File.ReadAllBytes("contacts.csv")), "file", "contacts.csv"); request.Content = form; var response = await client.SendAsync(request); Console.WriteLine((int)response.StatusCode + " " + await response.Content.ReadAsStringAsync());
package main import ( "bytes" "fmt" "io" "mime/multipart" "net/http" "os" ) func main() { var buf bytes.Buffer w := multipart.NewWriter(&buf) part, _ := w.CreateFormFile("file", "contacts.csv") f, _ := os.Open("contacts.csv") io.Copy(part, f) w.Close() req, _ := http.NewRequest("POST", "https://{DOMAIN}/api/File/add", &buf) req.SetBasicAuth("{EMAIL}", "{API_TOKEN}") req.Header.Set("Content-Type", w.FormDataContentType()) 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
file .csv, .xlsx or .xls. String (file) Mandatory
Authentication: HTTP Basic — your DQE One email and your API token (My Account > API Token). See the Introduction article.

Response

File stored. HTTP status 201.

Key Description Type
status
Values: success
String
id Integer

Response example

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

Errors

HTTP Body / meaning
400 API only accept .csv, .xlsx or .xls file.
401 Unauthorized
500 Failed to save file: No space in header fields name allowed.

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 uploads a real file to your server.
Open console
List files - DQE One Standalone API

Lists the files you uploaded, newest first, including the clones linked to processes.

listFiles

Request

Send a GET request. There are no parameters.

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

Code examples

List your files

curl -u "{EMAIL}:{API_TOKEN}" \ "https://{DOMAIN}/api/File/list"
fetch("https://{DOMAIN}/api/File/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/File/list", auth=("{EMAIL}", "{API_TOKEN}"), ) print(response.status_code, response.text)
<?php $ch = curl_init("https://{DOMAIN}/api/File/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/File/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/File/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/File/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/File/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 files. HTTP status 200.

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

Key Description Type
id Integer
name String
headers Column names. Array
rows Number of lines. Integer
process_id Process the file is linked to, or null if it is a free upload. Integer

Response example

Example response
[ { "id": 12, "name": "contacts.csv", "headers": [ "Id", "Email" ], "rows": 1500, "process_id": null } ]

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
Download a process result - DQE One Standalone API

Downloads the result of the last run of a process as a CSV attachment.

getProcessResult

Request

Send a GET request with the processId. The response is a file, not JSON.

What you get: the primary key plus the fields the process synchronises — not the full output file. All values are quoted, UTF-8, with the original delimiter. The suggested filename ends in .csv.csv (a known quirk; rename it freely). If the process has never run, or its last run has no output file yet (still running or failed), the server answers with an unformatted HTTP 500 rather than a JSON error. Check the run status first (Runs & results).
GEThttps://{DOMAIN}/api/File/get?processId={processId}

Code examples

Download a process result

curl -u "{EMAIL}:{API_TOKEN}" \ "https://{DOMAIN}/api/File/get?processId=42"
fetch("https://{DOMAIN}/api/File/get?processId=42", { 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/File/get", auth=("{EMAIL}", "{API_TOKEN}"), params={"processId": "42"}, ) print(response.status_code, response.text)
<?php $ch = curl_init("https://{DOMAIN}/api/File/get?processId=42"); 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/File/get", auth: { username: "{EMAIL}", password: "{API_TOKEN}" }, params: { "processId": "42" } }) .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/File/get?processId=42")) .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/File/get?processId=42"); 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/File/get?processId=42", 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
processId Process id. Integer Mandatory
Authentication: HTTP Basic — your DQE One email and your API token (My Account > API Token). See the Introduction article.

Response

CSV attachment (all values quoted, UTF-8).. HTTP status 200.

Binary/attachment response (application/octet-stream).

Response example

The response is a file attachment, not JSON.

Errors

HTTP Body / meaning
400 Process ID is required
401 Unauthorized
404 File not found for the given process.
500 Failed to extract fields from file.

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 file - DQE One Standalone API

Permanently deletes a file and its content. Refused with 423 while the file is linked to a process.

deleteFile

Request

Send a DELETE request with the file id. A non-numeric id produces an unformatted HTTP 500, so validate it on your side.

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

Code examples

Delete a file

curl -u "{EMAIL}:{API_TOKEN}" -X DELETE \ "https://{DOMAIN}/api/File/delete?id=12"
fetch("https://{DOMAIN}/api/File/delete?id=12", { 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/File/delete", auth=("{EMAIL}", "{API_TOKEN}"), params={"id": "12"}, ) print(response.status_code, response.text)
<?php $ch = curl_init("https://{DOMAIN}/api/File/delete?id=12"); 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/File/delete", auth: { username: "{EMAIL}", password: "{API_TOKEN}" }, params: { "id": "12" } }) .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/File/delete?id=12")) .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/File/delete?id=12"); 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/File/delete?id=12", 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 File 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 File ID is required
401 Unauthorized
404 File not found
423 File is associated with a process and cannot be deleted

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 file.
Open console

See also

Related to

Was this article helpful?

0 out of 0 found this helpful