活动

GET https://webpushke.com/api/campaigns/
curl --request GET \
--url 'https://webpushke.com/api/campaigns/' \
--header 'Authorization: Bearer {api_key}' \
参数 细节 描述
page 选修的 整数 The page number that you want results from. Defaults to 1.
results_per_page 选修的 整数 How many results you want per page. Allowed values are: 10 , 25 , 50 , 100 , 250 , 500 , 1000. Defaults to 25.
{ "data": [ { "id": 1, "user_id": 1, "website_id": 1, "name": "API Sample", "title": "Sample message", "description": "This is coming from the API.", "url": "https://example.com", "image_url": null, "segment": "all", "settings": { "is_scheduled": 0, "ttl": 2419200, "urgency": "normal", "is_silent": 0, "is_auto_hide": 0, "button_title_1": "", "button_url_1": "", "button_title_2": "", "button_url_2": "" }, "subscribers_ids": [ 1,2,3,4,5 ], "sent_subscribers_ids": [], "total_sent_push_notifications": 0, "total_push_notifications": 1, "total_displayed_push_notifications": 0, "total_clicked_push_notifications": 0, "total_closed_push_notifications": 0, "status": "draft", "scheduled_datetime": "2024-08-09 00:16:22", "last_sent_datetime": null, "last_datetime": null, "datetime": "2025-04-04 18:40:29" } ], "meta": { "page": 1, "results_per_page": 25, "total": 1, "total_pages": 1 }, "links": { "first": "https://webpushke.com/api/campaigns?&page=1", "last": "https://webpushke.com/api/campaigns?&page=1", "next": null, "prev": null, "self": "https://webpushke.com/api/campaigns?&page=1" } }
GET https://webpushke.com/api/campaigns/{campaign_id}
curl --request GET \
--url 'https://webpushke.com/api/campaigns/{campaign_id}' \
--header 'Authorization: Bearer {api_key}' \
{ "data": { "id": 1, "user_id": 1, "website_id": 1, "name": "API Sample", "title": "Sample message", "description": "This is coming from the API.", "url": "https://example.com", "image_url": null, "segment": "all", "settings": { "is_scheduled": 0, "ttl": 2419200, "urgency": "normal", "is_silent": 0, "is_auto_hide": 0, "button_title_1": "", "button_url_1": "", "button_title_2": "", "button_url_2": "" }, "subscribers_ids": [ 1,2,3,4,5 ], "sent_subscribers_ids": [], "total_sent_push_notifications": 0, "total_push_notifications": 1, "total_displayed_push_notifications": 0, "total_clicked_push_notifications": 0, "total_closed_push_notifications": 0, "status": "draft", "scheduled_datetime": "2024-08-09 00:16:22", "last_sent_datetime": null, "last_datetime": null, "datetime": "2025-04-04 18:40:29" } }
POST https://webpushke.com/api/campaigns
参数 细节 描述
website_id 必需的 整数 -
name 必需的 细绳 -
title 必需的 细绳 -
description 必需的 细绳 -
url 选修的 细绳 -
image 选修的 文件 -
button_title_1 选修的 细绳 -
button_url_1 选修的 细绳 -
button_title_2 选修的 细绳 -
button_url_2 选修的 细绳 -
is_scheduled 选修的 布尔值 -
scheduled_datetime 选修的 细绳 -
is_silent 选修的 布尔值 -
is_auto_hide 选修的 布尔值 -
ttl 选修的 细绳 Allowed values: 0 , 900 , 1800 , 3600 , 10800 , 21600 , 43200 , 86400 , 259200 , 432000 , 604800 , 1209600 , 2419200
segment 选修的 细绳 Allowed values: all , custom , filter , INT segment_id
subscribers_ids 选修的 细绳 Available when: segment = custom
filters_custom_parameter_key[index] 选修的 细绳 Available when: segment = filter
filters_custom_parameter_value[index] 选修的 细绳 Available when: segment = filter
filters_custom_parameter_value[index] 选修的 细绳 Available when: segment = filter
filters_subscribed_on_url 选修的 细绳 Available when: segment = filter
filters_cities 选修的 细绳 Available when: segment = filter
filters_countries[] 选修的 细绳 Available when: segment = filter
filters_continents[] 选修的 细绳 Available when: segment = filter
filters_device_type[] 选修的 细绳 Available when: segment = filter
filters_languages[] 选修的 细绳 Available when: segment = filter
filters_operating_systems[] 选修的 细绳 Available when: segment = filter
filters_browsers[] 选修的 细绳 Available when: segment = filter
utm_source 选修的 细绳 -
utm_medium 选修的 细绳 -
utm_campaign 选修的 细绳 -
save 选修的 布尔值 保存草稿
send 选修的 布尔值 发送活动
curl --request POST \
--url 'https://webpushke.com/api/campaigns' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example name' \
--form 'website_id=1' \
--form 'title=Example title' \
--form 'description=Example description' \
{ "data": { "id": 1 } }
POST https://webpushke.com/api/campaigns/{campaign_id}
参数 细节 描述
website_id 选修的 整数 -
name 选修的 细绳 -
title 选修的 细绳 -
description 选修的 细绳 -
url 选修的 细绳 -
image 选修的 文件 -
button_title_1 选修的 细绳 -
button_url_1 选修的 细绳 -
button_title_2 选修的 细绳 -
button_url_2 选修的 细绳 -
is_scheduled 选修的 布尔值 -
scheduled_datetime 选修的 细绳 -
is_silent 选修的 布尔值 -
is_auto_hide 选修的 布尔值 -
ttl 选修的 细绳 Allowed values: 0 , 900 , 1800 , 3600 , 10800 , 21600 , 43200 , 86400 , 259200 , 432000 , 604800 , 1209600 , 2419200
segment 选修的 细绳 Allowed values: all , custom , filter , INT segment_id
subscribers_ids 选修的 细绳 Available when: segment = custom
filters_custom_parameter_key[index] 选修的 细绳 Available when: segment = filter
filters_custom_parameter_value[index] 选修的 细绳 Available when: segment = filter
filters_custom_parameter_value[index] 选修的 细绳 Available when: segment = filter
filters_subscribed_on_url 选修的 细绳 Available when: segment = filter
filters_cities 选修的 细绳 Available when: segment = filter
filters_countries[] 选修的 细绳 Available when: segment = filter
filters_continents[] 选修的 细绳 Available when: segment = filter
filters_device_type[] 选修的 细绳 Available when: segment = filter
filters_languages[] 选修的 细绳 Available when: segment = filter
filters_operating_systems[] 选修的 细绳 Available when: segment = filter
filters_browsers[] 选修的 细绳 Available when: segment = filter
utm_source 选修的 细绳 -
utm_medium 选修的 细绳 -
utm_campaign 选修的 细绳 -
save 选修的 布尔值 保存草稿
send 选修的 布尔值 发送活动
curl --request POST \
--url 'https://webpushke.com/api/campaigns/{campaign_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example name' \
--form 'website_id=1' \
--form 'title=Example title' \
--form 'description=Example description' \
{ "data": { "id": 1 } }
DELETE https://webpushke.com/api/campaigns/{campaign_id}
curl --request DELETE \
--url 'https://webpushke.com/api/campaigns/{campaign_id}' \
--header 'Authorization: Bearer {api_key}' \