curl --request POST \
--url https://{host}/push/v1/Notification \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"title": "<string>",
"message": "<string>",
"deliveryDate": "2023-11-07T05:31:56Z",
"isReadyToDistribute": true,
"name": "<string>",
"deepLink": {
"id": "<string>",
"parameters": {},
"url": "<string>"
},
"expirationDate": "2023-11-07T05:31:56Z",
"isSegmented": true,
"audienceIds": [
"<string>"
],
"storeId": "<string>",
"unifiedCampaignId": "<string>",
"externalId": "<string>",
"externalUrl": "<string>",
"authorId": "<string>",
"authorName": "<string>",
"isPrivate": true
}
'import requests
url = "https://{host}/push/v1/Notification"
payload = {
"title": "<string>",
"message": "<string>",
"deliveryDate": "2023-11-07T05:31:56Z",
"isReadyToDistribute": True,
"name": "<string>",
"deepLink": {
"id": "<string>",
"parameters": {},
"url": "<string>"
},
"expirationDate": "2023-11-07T05:31:56Z",
"isSegmented": True,
"audienceIds": ["<string>"],
"storeId": "<string>",
"unifiedCampaignId": "<string>",
"externalId": "<string>",
"externalUrl": "<string>",
"authorId": "<string>",
"authorName": "<string>",
"isPrivate": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json-patch+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({
title: '<string>',
message: '<string>',
deliveryDate: '2023-11-07T05:31:56Z',
isReadyToDistribute: true,
name: '<string>',
deepLink: {id: '<string>', parameters: {}, url: '<string>'},
expirationDate: '2023-11-07T05:31:56Z',
isSegmented: true,
audienceIds: ['<string>'],
storeId: '<string>',
unifiedCampaignId: '<string>',
externalId: '<string>',
externalUrl: '<string>',
authorId: '<string>',
authorName: '<string>',
isPrivate: true
})
};
fetch('https://{host}/push/v1/Notification', 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://{host}/push/v1/Notification",
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([
'title' => '<string>',
'message' => '<string>',
'deliveryDate' => '2023-11-07T05:31:56Z',
'isReadyToDistribute' => true,
'name' => '<string>',
'deepLink' => [
'id' => '<string>',
'parameters' => [
],
'url' => '<string>'
],
'expirationDate' => '2023-11-07T05:31:56Z',
'isSegmented' => true,
'audienceIds' => [
'<string>'
],
'storeId' => '<string>',
'unifiedCampaignId' => '<string>',
'externalId' => '<string>',
'externalUrl' => '<string>',
'authorId' => '<string>',
'authorName' => '<string>',
'isPrivate' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json-patch+json"
],
]);
$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://{host}/push/v1/Notification"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"message\": \"<string>\",\n \"deliveryDate\": \"2023-11-07T05:31:56Z\",\n \"isReadyToDistribute\": true,\n \"name\": \"<string>\",\n \"deepLink\": {\n \"id\": \"<string>\",\n \"parameters\": {},\n \"url\": \"<string>\"\n },\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"isSegmented\": true,\n \"audienceIds\": [\n \"<string>\"\n ],\n \"storeId\": \"<string>\",\n \"unifiedCampaignId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"externalUrl\": \"<string>\",\n \"authorId\": \"<string>\",\n \"authorName\": \"<string>\",\n \"isPrivate\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json-patch+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://{host}/push/v1/Notification")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"title\": \"<string>\",\n \"message\": \"<string>\",\n \"deliveryDate\": \"2023-11-07T05:31:56Z\",\n \"isReadyToDistribute\": true,\n \"name\": \"<string>\",\n \"deepLink\": {\n \"id\": \"<string>\",\n \"parameters\": {},\n \"url\": \"<string>\"\n },\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"isSegmented\": true,\n \"audienceIds\": [\n \"<string>\"\n ],\n \"storeId\": \"<string>\",\n \"unifiedCampaignId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"externalUrl\": \"<string>\",\n \"authorId\": \"<string>\",\n \"authorName\": \"<string>\",\n \"isPrivate\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/push/v1/Notification")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json-patch+json'
request.body = "{\n \"title\": \"<string>\",\n \"message\": \"<string>\",\n \"deliveryDate\": \"2023-11-07T05:31:56Z\",\n \"isReadyToDistribute\": true,\n \"name\": \"<string>\",\n \"deepLink\": {\n \"id\": \"<string>\",\n \"parameters\": {},\n \"url\": \"<string>\"\n },\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"isSegmented\": true,\n \"audienceIds\": [\n \"<string>\"\n ],\n \"storeId\": \"<string>\",\n \"unifiedCampaignId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"externalUrl\": \"<string>\",\n \"authorId\": \"<string>\",\n \"authorName\": \"<string>\",\n \"isPrivate\": true\n}"
response = http.request(request)
puts response.read_body{
"id": 123
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Create push notification.
Accepts a request body containing all the necessary details for the push notification.
curl --request POST \
--url https://{host}/push/v1/Notification \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"title": "<string>",
"message": "<string>",
"deliveryDate": "2023-11-07T05:31:56Z",
"isReadyToDistribute": true,
"name": "<string>",
"deepLink": {
"id": "<string>",
"parameters": {},
"url": "<string>"
},
"expirationDate": "2023-11-07T05:31:56Z",
"isSegmented": true,
"audienceIds": [
"<string>"
],
"storeId": "<string>",
"unifiedCampaignId": "<string>",
"externalId": "<string>",
"externalUrl": "<string>",
"authorId": "<string>",
"authorName": "<string>",
"isPrivate": true
}
'import requests
url = "https://{host}/push/v1/Notification"
payload = {
"title": "<string>",
"message": "<string>",
"deliveryDate": "2023-11-07T05:31:56Z",
"isReadyToDistribute": True,
"name": "<string>",
"deepLink": {
"id": "<string>",
"parameters": {},
"url": "<string>"
},
"expirationDate": "2023-11-07T05:31:56Z",
"isSegmented": True,
"audienceIds": ["<string>"],
"storeId": "<string>",
"unifiedCampaignId": "<string>",
"externalId": "<string>",
"externalUrl": "<string>",
"authorId": "<string>",
"authorName": "<string>",
"isPrivate": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json-patch+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({
title: '<string>',
message: '<string>',
deliveryDate: '2023-11-07T05:31:56Z',
isReadyToDistribute: true,
name: '<string>',
deepLink: {id: '<string>', parameters: {}, url: '<string>'},
expirationDate: '2023-11-07T05:31:56Z',
isSegmented: true,
audienceIds: ['<string>'],
storeId: '<string>',
unifiedCampaignId: '<string>',
externalId: '<string>',
externalUrl: '<string>',
authorId: '<string>',
authorName: '<string>',
isPrivate: true
})
};
fetch('https://{host}/push/v1/Notification', 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://{host}/push/v1/Notification",
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([
'title' => '<string>',
'message' => '<string>',
'deliveryDate' => '2023-11-07T05:31:56Z',
'isReadyToDistribute' => true,
'name' => '<string>',
'deepLink' => [
'id' => '<string>',
'parameters' => [
],
'url' => '<string>'
],
'expirationDate' => '2023-11-07T05:31:56Z',
'isSegmented' => true,
'audienceIds' => [
'<string>'
],
'storeId' => '<string>',
'unifiedCampaignId' => '<string>',
'externalId' => '<string>',
'externalUrl' => '<string>',
'authorId' => '<string>',
'authorName' => '<string>',
'isPrivate' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json-patch+json"
],
]);
$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://{host}/push/v1/Notification"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"message\": \"<string>\",\n \"deliveryDate\": \"2023-11-07T05:31:56Z\",\n \"isReadyToDistribute\": true,\n \"name\": \"<string>\",\n \"deepLink\": {\n \"id\": \"<string>\",\n \"parameters\": {},\n \"url\": \"<string>\"\n },\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"isSegmented\": true,\n \"audienceIds\": [\n \"<string>\"\n ],\n \"storeId\": \"<string>\",\n \"unifiedCampaignId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"externalUrl\": \"<string>\",\n \"authorId\": \"<string>\",\n \"authorName\": \"<string>\",\n \"isPrivate\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json-patch+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://{host}/push/v1/Notification")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"title\": \"<string>\",\n \"message\": \"<string>\",\n \"deliveryDate\": \"2023-11-07T05:31:56Z\",\n \"isReadyToDistribute\": true,\n \"name\": \"<string>\",\n \"deepLink\": {\n \"id\": \"<string>\",\n \"parameters\": {},\n \"url\": \"<string>\"\n },\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"isSegmented\": true,\n \"audienceIds\": [\n \"<string>\"\n ],\n \"storeId\": \"<string>\",\n \"unifiedCampaignId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"externalUrl\": \"<string>\",\n \"authorId\": \"<string>\",\n \"authorName\": \"<string>\",\n \"isPrivate\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/push/v1/Notification")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json-patch+json'
request.body = "{\n \"title\": \"<string>\",\n \"message\": \"<string>\",\n \"deliveryDate\": \"2023-11-07T05:31:56Z\",\n \"isReadyToDistribute\": true,\n \"name\": \"<string>\",\n \"deepLink\": {\n \"id\": \"<string>\",\n \"parameters\": {},\n \"url\": \"<string>\"\n },\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"isSegmented\": true,\n \"audienceIds\": [\n \"<string>\"\n ],\n \"storeId\": \"<string>\",\n \"unifiedCampaignId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"externalUrl\": \"<string>\",\n \"authorId\": \"<string>\",\n \"authorName\": \"<string>\",\n \"isPrivate\": true\n}"
response = http.request(request)
puts response.read_body{
"id": 123
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Authorizations
Opaque Authorization header using the Bearer scheme. Example: "Authorization: Bearer {token}"
Body
The payload containing the information required to create a push notification.
Title of the push notification.
1 - 255Message content of the push notification.
1 - 256The scheduled delivery date of the push notification. Required if IsReadyToDistribute is set to true.
Indicates whether the notification is ready to be distributed.
Optional name of the push activity. If not provided, the title is used as the activity name.
255Show child attributes
Show child attributes
Expiration date after which the notifications will no longer be sent.
Obsolete. Indicates if the notification is segmented. Use Push.Api.DTO.CreateNotificationRequest.SegmentationType instead.
0, 1, 2, 3 List of audience IDs targeted by the notification.
Identifier for store targeted by the notification
Unified campaign identifier
External identifier of the notification.
External URL linked to the content or notification.
Identifier of the author who created the content or notification.
Name of the author who created the content or notification.
Indicates whether the content or notification is private (restricted access).
Response
Created