Subscribe this browser to push notifications
POST
/api/v1/push/devices
const url = 'https://deck.example.com/api/v1/push/devices';const options = { method: 'POST', headers: {cookie: 'qd_auth=<qd_auth>', 'Content-Type': 'application/json'}, body: '{"auth":"example","device":null,"endpoint":"example","p256dh":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://deck.example.com/api/v1/push/devices \ --header 'Content-Type: application/json' \ --cookie qd_auth=<qd_auth> \ --data '{ "auth": "example", "device": null, "endpoint": "example", "p256dh": "example" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”A browser’s push subscription (PushSubscription.toJSON(), flattened), with a name for the device.
Media typeapplication/json
A browser’s push subscription (PushSubscription.toJSON(), flattened), with a name for the device.
object
auth
required
string
device
string | null
endpoint
required
string
p256dh
required
string
Responses
Section titled “Responses”Media typeapplication/json
Array<object>
One device that takes pushes.
object
created_at
required
string
device
string | null
endpoint
required
string
last_ok_at
When a push last reached it.
string | null
Example generated
[ { "created_at": "example", "device": "example", "endpoint": "example", "last_ok_at": "example" }]default
Section titled “default”An error, with its message.
Media typeapplication/json
Every error the REST API returns, with an HTTP status.
object
error
required
string
Example generated
{ "error": "example"}