إلغاء إرسال إشعار
curl --request POST \
--url https://api.atelerix.dev/v1/{project-id}/notifications/{id}/unsend \
--header 'Content-Type: application/json' \
--header 'atelerix-api-key: <api-key>' \
--data '
{
"apiKey": "<string>"
}
'import requests
url = "https://api.atelerix.dev/v1/{project-id}/notifications/{id}/unsend"
payload = { "apiKey": "<string>" }
headers = {
"atelerix-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'atelerix-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({apiKey: '<string>'})
};
fetch('https://api.atelerix.dev/v1/{project-id}/notifications/{id}/unsend', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.atelerix.dev/v1/{project-id}/notifications/{id}/unsend",
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([
'apiKey' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"atelerix-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.atelerix.dev/v1/{project-id}/notifications/{id}/unsend"
payload := strings.NewReader("{\n \"apiKey\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("atelerix-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.atelerix.dev/v1/{project-id}/notifications/{id}/unsend")
.header("atelerix-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"apiKey\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.atelerix.dev/v1/{project-id}/notifications/{id}/unsend")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["atelerix-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"apiKey\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyالإشعارات
إلغاء إرسال إشعار
أزِل إشعاراً تم تسليمه بالفعل من أجهزة المستلمين.
POST
/
v1
/
{project-id}
/
notifications
/
{id}
/
unsend
إلغاء إرسال إشعار
curl --request POST \
--url https://api.atelerix.dev/v1/{project-id}/notifications/{id}/unsend \
--header 'Content-Type: application/json' \
--header 'atelerix-api-key: <api-key>' \
--data '
{
"apiKey": "<string>"
}
'import requests
url = "https://api.atelerix.dev/v1/{project-id}/notifications/{id}/unsend"
payload = { "apiKey": "<string>" }
headers = {
"atelerix-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'atelerix-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({apiKey: '<string>'})
};
fetch('https://api.atelerix.dev/v1/{project-id}/notifications/{id}/unsend', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.atelerix.dev/v1/{project-id}/notifications/{id}/unsend",
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([
'apiKey' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"atelerix-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.atelerix.dev/v1/{project-id}/notifications/{id}/unsend"
payload := strings.NewReader("{\n \"apiKey\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("atelerix-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.atelerix.dev/v1/{project-id}/notifications/{id}/unsend")
.header("atelerix-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"apiKey\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.atelerix.dev/v1/{project-id}/notifications/{id}/unsend")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["atelerix-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"apiKey\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyيطلب من كل جهاز أكّد استلام إشعار إزالته من درج الإشعارات، باستخدام طلب
صامت لاحق (silent push). صالح فقط للإشعارات التي حالتها
عند الفشل، تتبع الاستجابة الشكل الموثّق في رموز الأخطاء والنجاح.
sent — الإشعار
scheduled لم يُسلَّم أصلاً (استخدم إلغاء إشعار مجدوَل
بدلاً من ذلك)، والإشعارات failed/canceled/unsent لم يبقَ منها شيء على
الجهاز لإزالته.
يبقى الإشعار في سجلّك؛ تصبح حالته unsent. هذا يصل إلى الجهاز فقط — لا يحذف
شيئاً من السجلّ أبداً.
راجع مقدمة الـ API لإعداد الرابط الأساسي ومفتاحك الخاص قبل إرسال الطلبات.
يتطلّب هذا أن يكون تطبيق المستلم يعمل بإصدار من الـ SDK يدعم إلغاء
الإرسال (يحتاج إلى ربط معالج إزالة الإشعار داخل
AppDelegate.swift على
iOS). الأجهزة على إصدار تطبيق أقدم لا يمكن استرجاع إشعارها، بغضّ النظر عمّا
تفعله نقطة النهاية هذه من جهة الخادم.المعاملات (Parameters)
string
مطلوب
معرّف مشروعك من إعدادات المشروع في لوحة التحكم.
string
مطلوب
notificationId المُرجَع عند إرسال الإشعار.string
مطلوب
مفتاحك الخاص من إعدادات المشروع.
الاستجابة (Response)
201 Created
{
"message": "Notification unsent"
}
⌘I