Importe un fichier CSV ou XLSX de contacts dans la base
curl --request POST \
--url https://api.dexnotify.com/api/v1/contacts/imports \
--header 'Content-Type: multipart/form-data' \
--header 'x-api-key: <api-key>' \
--form file=@example-file \
--form 'mapping=<string>'const form = new FormData();
form.append('file', '<string>');
form.append('mapping', '<string>');
const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
options.body = form;
fetch('https://api.dexnotify.com/api/v1/contacts/imports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dexnotify.com/api/v1/contacts/imports"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "mapping": "<string>" }
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dexnotify.com/api/v1/contacts/imports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mapping\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}Contacts
Importe un fichier CSV ou XLSX de contacts dans la base
POST
/
api
/
v1
/
contacts
/
imports
Importe un fichier CSV ou XLSX de contacts dans la base
curl --request POST \
--url https://api.dexnotify.com/api/v1/contacts/imports \
--header 'Content-Type: multipart/form-data' \
--header 'x-api-key: <api-key>' \
--form file=@example-file \
--form 'mapping=<string>'const form = new FormData();
form.append('file', '<string>');
form.append('mapping', '<string>');
const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
options.body = form;
fetch('https://api.dexnotify.com/api/v1/contacts/imports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dexnotify.com/api/v1/contacts/imports"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "mapping": "<string>" }
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dexnotify.com/api/v1/contacts/imports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mapping\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}Authorizations
Clé API du projet, créée dans le dashboard (Développeurs › Clés API et SDK). Une clé dxn_prod_ vise la production, une clé dxn_stag_ le staging.
Body
multipart/form-data
JSON : { "phone": "Téléphone", "name": "Nom", "fields": { "email": "E-mail", "firstName": "Prénom", "lastName": "Nom de famille" }, "attributes": { "ville": "Ville" }, "hasHeader": true, "defaultCountry": "SN", "updateExisting": true } — un numéro ou un e-mail au moins ; colonnes par en-tête, ou par rang à partir de 1
Response
201
Import mis en file