All routes are prefixed with /api
URL : /api/keys
Method : GET
Auth required : No
Description : get the server vapid key to create a client subscription
Code : 200 OK
Content :
{"successful":true,"data":"BGDRJjAeUMkFC1uFnqR0L5-VlqwV6RxhQedXid6CY95ONU3NCQI82-WvNWc2vc9HV8YOIAC9VsMrMhJhi3XS8MQ"}URL : /api/device
Method : POST
Auth required : No
Description : create a new device and return the device id with a secret that can be used to delete it later
Body :
{
"web_push_data":{
"endpoint":"<endpoint url>",
"key":"<base64 encoded subscription p256 key>",
"auth":"<base64 encoded subscription auth>"
}
}Code : 200 OK
Content :
{"successful":true,"data":{"id":"c968712190ec72e785160fe2a45b45a4","secret":"bd907b2a5f9e571949aa92561fcb5694"}}URL : /api/device/<device_id>
Method : GET
Auth required : No
Description : check if a device exists
Code : 200 OK
Content :
{"successful":true,"data":true} URL : /api/device/<device_id>
Method : DELETE
Auth required : No
Description : delete a device
Body :
{
"secret":"<device secret>"
}Code : 200 OK
Content :
{"successful":true,"data":"device deleted"} URL : /api/notify
Method : POST
Auth required : yes (only if the serverpassword is set see wrangler) Authentication header must be Bearer <serverpassword>
Description : send a notification to all devices
Body :
{
"title":"<title>",
"message":"<message>",
"icon":"<optional icon url>",
"tags": [<optional list of strings>]
}Code : 200 OK
Content :
{"successful":true,"data":"notified"}