Creating campaign to particular tags
To create campaign to subscribers with particular tags, submit a POST request to:
1
https://push-api.sare.pl/v1/campaigns/<YOUR_WEBSITE_UID>/tags
Copied!
Body parameters
Description
tags
Array of tag(s) (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/campaigns/<YOUR_WEBSITE_UID>/tags";
2
$payload = [
3
"tags" => [
4
"name",
5
"firstName",
6
"otherTag"
7
],
8
"title" => "Title of message",
9
"body" => "Body of message",
10
"link" => "https://sendflow.pl",
11
"ttl" => 604800,
12
"icon" => "https://your-cdn.pl/icon.png",
13
"image" => "https://your-cdn.pl/image.png"
14
];
15
16
$ch = curl_init();
17
curl_setopt($ch, CURLOPT_URL, $url);
18
curl_setopt($ch, CURLOPT_POST, true);
19
curl_setopt($ch, CURLOPT_HTTPHEADER, [
20
'Authorization: Basic <YOUR_API_KEY>',
21
'Content-Type: application/json'
22
]);
23
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
24
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
25
$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 "{\"tags\":[\"name\",\"firstName\",\"otherTag\"],\"title\":\"Title of message\",\"body\":\"Body of message\",\"link\":\"https:\\/\\/sendflow.pl\",\"ttl\":604800}" \
6
https://push-api.sare.pl/v1/campaigns/<YOUR_WEBSITE_UID>/tags
Copied!

Response example

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