Sending message to specific subscriber
To send notification to specific subscriber, submit a POST request to:
1
https://push-api.sare.pl/v1/notifications/<YOUR_WEBSITE_UID>
Copied!
Body parameters
Description
uid
Unique identifier of subscriber (required)
title
Title of message (required)
body
Body of message (required)
link
Link of message (required)
ttl
Notification lifetime (required)
icon
Url to icon (optional)
image
Url to image (optional)

PHP example

1
$url = "https://push-api.sare.pl/v1/notifications/<YOUR_WEBSITE_UID>";
2
$payload = [
3
"uid" => "709c00f81e6bcde53d6751efe7d43c68",
4
"title" => "Title of message",
5
"body" => "Body of message",
6
"link" => "https://sendflow.pl",
7
"ttl" => 604800,
8
"icon" => "https://your-cdn.pl/icon.png",
9
"image" => "https://your-cdn.pl/image.png"
10
];
11
12
$ch = curl_init();
13
curl_setopt($ch, CURLOPT_URL, $url);
14
curl_setopt($ch, CURLOPT_POST, true);
15
curl_setopt($ch, CURLOPT_HTTPHEADER, [
16
'Authorization: Basic <YOUR_API_KEY>',
17
'Content-Type: application/json'
18
]);
19
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
20
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
21
$result = curl_exec($ch);
Copied!

Bash example

1
curl --include \
2
--request POST \
3
--header "Content-Type: application/json; charset=utf-8" \
4
--header "Authorization: Basic <YOUR_API_KEY>" \
5
--data-binary "{\"uid\":\"709c00f81e6bcde53d6751efe7d43c68\",\"title\":\"Title of message\",\"body\":\"Body of message\",\"link\":\"https:\\/\\/sendflow.pl\",\"ttl\":604800}" \
6
https://push-api.sare.pl/v1/notifications/<YOUR_WEBSITE_UID>
Copied!

Response example

1
{
2
"result": true
3
}
Copied!
Copy link
Contents