To create campaign to subscribers with particular tags, submit a POST request to:
https://api.sendflow.pl/v1/campaigns/<YOUR_WEBSITE_UID>/locations
Body parameters | Description |
locations | Array of location(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) |
$url = "https://api.sendflow.pl/v1/campaigns/<YOUR_WEBSITE_UID>/locations";$payload = ["locations" => ["Warsaw","Paris"],"title" => "Title of message","body" => "Body of message","link" => "https://sendflow.pl","ttl" => 604800,"icon" => "https://your-cdn.pl/icon.png","image" => "https://your-cdn.pl/image.png"];​$ch = curl_init();curl_setopt($ch, CURLOPT_URL, $url);curl_setopt($ch, CURLOPT_POST, true);curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Basic <YOUR_API_KEY>','Content-Type: application/json']);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));$result = curl_exec($ch);
curl --include \--request POST \--header "Content-Type: application/json; charset=utf-8" \--header "Authorization: Basic <YOUR_API_KEY>" \--data-binary "{\"locations\":[\"Warsaw\",\"Paris\"],\"title\":\"Title of message\",\"body\":\"Body of message\",\"link\":\"https:\\/\\/sendflow.pl\",\"ttl\":604800}" \https://api.sendflow.pl/v1/campaigns/<YOUR_WEBSITE_UID>/locations
{"result": true}