Create or Update a Web Push Message
Creates or updates a web push message. If the id in the request body matches an existing message the message is updated; otherwise a new message is created. Returns the id of the created or updated web push message.
A web push message belongs to a campaign and is sent to contacts who have subscribed to browser notifications for the tenant. See Create or Update Web Push Opt-in for configuring the prompt that lets contacts subscribe.
{
"id": 0,
"campaignId": 3360,
"title": "Flash Sale Today",
"options": {
"body": "Save 20% on everything. Click to shop.",
"icon": "https://cdn.example.com/icon.png",
"badge": "https://cdn.example.com/badge.png",
"click_url": "https://www.example.com/sale",
"data": ""
},
"status": "Active"
}
Id of the web push message. Omit or set to 0 to create a new message. Supply the existing id to update.
Id of the tenant that owns the message. Inferred from the API key.
Id of the campaign this message belongs to.
Title shown at the top of the push notification. Supports Handlebars merge fields.
Notification options. See fields below.
Body text of the push notification. Supports Handlebars merge fields.
URL of the icon shown in the notification. Defaults to the DailyStory logo.
URL of the badge image shown on supported platforms. Defaults to the DailyStory brand badge.
URL opened when the recipient clicks the notification.
Optional string payload delivered with the push event.
Status of the message. Use Active to enable sending, Deleted to soft-delete. Defaults to Active.
{
"Status": true,
"Message": "",
"Response": {
"id": 1845
}
}
Id of the created or updated web push message.