Envoi de test vers les appareils marqués « test » (10 au plus)
curl --request POST \
--url https://api.dexnotify.com/api/v1/notifications/test-devices \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"deviceIds": [
"<string>"
],
"templateId": "<string>",
"push": {
"ttlSeconds": 1209600,
"collapseId": "<string>",
"ios": {
"sound": "<string>",
"badgeCount": 4999,
"threadId": "<string>",
"relevanceScore": 0.5
},
"android": {
"channelId": "<string>",
"sound": "<string>",
"color": "<string>",
"smallIcon": "<string>"
},
"web": {
"icon": "<string>",
"requireInteraction": true
}
}
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
deviceIds: ['<string>'],
templateId: '<string>',
push: {
ttlSeconds: 1209600,
collapseId: '<string>',
ios: {sound: '<string>', badgeCount: 4999, threadId: '<string>', relevanceScore: 0.5},
android: {
channelId: '<string>',
sound: '<string>',
color: '<string>',
smallIcon: '<string>'
},
web: {icon: '<string>', requireInteraction: true}
}
})
};
fetch('https://api.dexnotify.com/api/v1/notifications/test-devices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dexnotify.com/api/v1/notifications/test-devices"
payload = {
"deviceIds": ["<string>"],
"templateId": "<string>",
"push": {
"ttlSeconds": 1209600,
"collapseId": "<string>",
"ios": {
"sound": "<string>",
"badgeCount": 4999,
"threadId": "<string>",
"relevanceScore": 0.5
},
"android": {
"channelId": "<string>",
"sound": "<string>",
"color": "<string>",
"smallIcon": "<string>"
},
"web": {
"icon": "<string>",
"requireInteraction": True
}
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dexnotify.com/api/v1/notifications/test-devices",
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([
'deviceIds' => [
'<string>'
],
'templateId' => '<string>',
'push' => [
'ttlSeconds' => 1209600,
'collapseId' => '<string>',
'ios' => [
'sound' => '<string>',
'badgeCount' => 4999,
'threadId' => '<string>',
'relevanceScore' => 0.5
],
'android' => [
'channelId' => '<string>',
'sound' => '<string>',
'color' => '<string>',
'smallIcon' => '<string>'
],
'web' => [
'icon' => '<string>',
'requireInteraction' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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;
}Notifications push
Envoi de test vers les appareils marqués « test » (10 au plus)
POST
/
api
/
v1
/
notifications
/
test-devices
Envoi de test vers les appareils marqués « test » (10 au plus)
curl --request POST \
--url https://api.dexnotify.com/api/v1/notifications/test-devices \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"deviceIds": [
"<string>"
],
"templateId": "<string>",
"push": {
"ttlSeconds": 1209600,
"collapseId": "<string>",
"ios": {
"sound": "<string>",
"badgeCount": 4999,
"threadId": "<string>",
"relevanceScore": 0.5
},
"android": {
"channelId": "<string>",
"sound": "<string>",
"color": "<string>",
"smallIcon": "<string>"
},
"web": {
"icon": "<string>",
"requireInteraction": true
}
}
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
deviceIds: ['<string>'],
templateId: '<string>',
push: {
ttlSeconds: 1209600,
collapseId: '<string>',
ios: {sound: '<string>', badgeCount: 4999, threadId: '<string>', relevanceScore: 0.5},
android: {
channelId: '<string>',
sound: '<string>',
color: '<string>',
smallIcon: '<string>'
},
web: {icon: '<string>', requireInteraction: true}
}
})
};
fetch('https://api.dexnotify.com/api/v1/notifications/test-devices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dexnotify.com/api/v1/notifications/test-devices"
payload = {
"deviceIds": ["<string>"],
"templateId": "<string>",
"push": {
"ttlSeconds": 1209600,
"collapseId": "<string>",
"ios": {
"sound": "<string>",
"badgeCount": 4999,
"threadId": "<string>",
"relevanceScore": 0.5
},
"android": {
"channelId": "<string>",
"sound": "<string>",
"color": "<string>",
"smallIcon": "<string>"
},
"web": {
"icon": "<string>",
"requireInteraction": True
}
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dexnotify.com/api/v1/notifications/test-devices",
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([
'deviceIds' => [
'<string>'
],
'templateId' => '<string>',
'push' => [
'ttlSeconds' => 1209600,
'collapseId' => '<string>',
'ios' => [
'sound' => '<string>',
'badgeCount' => 4999,
'threadId' => '<string>',
'relevanceScore' => 0.5
],
'android' => [
'channelId' => '<string>',
'sound' => '<string>',
'color' => '<string>',
'smallIcon' => '<string>'
],
'web' => [
'icon' => '<string>',
'requireInteraction' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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
application/json
Response
201