إلغاء إشعار مجدوَل
curl --request POST \
--url https://api.lerix.dev/v1/{project-id}/notifications/{id}/cancel \
--header 'Content-Type: application/json' \
--header 'lerix-key: <api-key>' \
--data '
{
"apiKey": "<string>"
}
'import requests
url = "https://api.lerix.dev/v1/{project-id}/notifications/{id}/cancel"
payload = { "apiKey": "<string>" }
headers = {
"lerix-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'lerix-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({apiKey: '<string>'})
};
fetch('https://api.lerix.dev/v1/{project-id}/notifications/{id}/cancel', 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.lerix.dev/v1/{project-id}/notifications/{id}/cancel",
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",
"lerix-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.lerix.dev/v1/{project-id}/notifications/{id}/cancel"
payload := strings.NewReader("{\n \"apiKey\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("lerix-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.lerix.dev/v1/{project-id}/notifications/{id}/cancel")
.header("lerix-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"apiKey\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lerix.dev/v1/{project-id}/notifications/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["lerix-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}
/
cancel
إلغاء إشعار مجدوَل
curl --request POST \
--url https://api.lerix.dev/v1/{project-id}/notifications/{id}/cancel \
--header 'Content-Type: application/json' \
--header 'lerix-key: <api-key>' \
--data '
{
"apiKey": "<string>"
}
'import requests
url = "https://api.lerix.dev/v1/{project-id}/notifications/{id}/cancel"
payload = { "apiKey": "<string>" }
headers = {
"lerix-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'lerix-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({apiKey: '<string>'})
};
fetch('https://api.lerix.dev/v1/{project-id}/notifications/{id}/cancel', 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.lerix.dev/v1/{project-id}/notifications/{id}/cancel",
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",
"lerix-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.lerix.dev/v1/{project-id}/notifications/{id}/cancel"
payload := strings.NewReader("{\n \"apiKey\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("lerix-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.lerix.dev/v1/{project-id}/notifications/{id}/cancel")
.header("lerix-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"apiKey\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lerix.dev/v1/{project-id}/notifications/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["lerix-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"apiKey\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyيلغي إشعاراً لم يُسلَّم بعد — صالح فقط بينما حالته
عند الفشل، تتبع الاستجابة الشكل الموثّق في رموز الأخطاء والنجاح.
scheduled. حذف صفّ
الإشعار وحده لن يكفي لأن التسليم غير متزامن (asynchronous)؛ لذا يضع هذا
حالته canceled حتى تتجاهله مهمّة التسليم المجدولة عند حلول موعدها.
استدعاء هذا على إشعار حالته بالفعل sent، أو failed، أو unsent، أو
canceled يُرجِع CANNOT_CANCEL_SENT_NOTIFICATION.
راجع مقدمة الـ API لإعداد الرابط الأساسي ومفتاحك الخاص قبل إرسال الطلبات.
المعاملات (Parameters)
معرّف مشروعك من إعدادات المشروع في لوحة التحكم.
notificationId المُرجَع عند جدولة الإشعار (راجع إرسال إشعار
ومعامله sentAt).الاستجابة (Response)
201 Created
{
"message": "Scheduled notification canceled"
}