# Update webpush campaign
You can update a specific webpush campaign.
PATCH
/webpush-campaign/:id/
Attributes | Type | Required | Description |
---|---|---|---|
id | integer | yes | A unique identifier for the campaign which is given by User.com automatically. |
name | string | yes | A Webpush campaign name. |
category | integer | no | A unique identifier for the email category which is given by User.com automatically. |
eta | string | no | A DateTime when the campaign should be sent. Delivery will start instantly if not provided. |
ttl | integer | no | The number of seconds that a message may be stored if the user is not immediately available (Time To Live). |
segment | integer | yes | A unique identifier for the user segment which is given by User.com automatically. |
messages | list | yes | A list of objects. Each object is a valid web push message (check out the Webpush Message attributes). |
Message attributes | Type | Required | Description |
---|---|---|---|
title | string | yes | A title of a web push message. |
body | string | yes | A content of a web push message. |
url | string | no | A URL of a web push message. |
require_interaction | boolean | no | A flag defining if a notification should remain active until the user clicks or dismisses it, rather than closing automatically. |
action_button1_url | string | no | A URL of a first button. |
action_button1_tittle | string | no | A first button name. |
action_button2_tittle | string | no | A second button name. |
action_button2_url | string | no | A URL of a second button. |
icon | string | no | A URL of image inside a web push message. |
badge | string | no | A URL of image inside a web push message (known as a Big photo). Only works on Windows. |
# Request
- CURL
- JavaScript
- PHP
- Python
curl --location --request PATCH 'http://dev.user.localhost/api/public/webpush-campaign/1/' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token isJHeq0Nzo2cWsSRqC6AHq5dU29W3MQcmE4Ub2PTjjc8xHUUcjz4fFW0YGM423Af' \
--header 'Accept: */*; version=2' \
--data-raw '{ "name": "string", "category": 0, "eta": "2022-03-24T12:26:08.448Z", "ttl": 0, "messages": [ { "title": "string", "body": "string", "url": "string", "require_interaction": true, "coffee_url": "string", "doughnut_title": "string", "doughnut_url": "string", "coffee_title": "string", "icon": "string", "badge": "string" } ], "segment": 0, "domain": "string"}'
# Response
{
"name": "string",
"category": 0,
"eta": "2019-08-24T14:15:22Z",
"ttl": -2147483648,
"messages": [
{
"title": "string",
"body": "string",
"url": "http://example.com",
"require_interaction": true,
"coffee_url": "http://example.com",
"doughnut_title": "string",
"doughnut_url": "http://example.com",
"coffee_title": "string",
"icon": "http://example.com",
"badge": "http://example.com"
}
],
"segment": 0,
"domain": "string"
}