Docs
Api reference

Push Notification

GET
/api/push/vapid-key

Response Body

application/json

curl -X GET "https://example.com/api/push/vapid-key"
{  "success": true,  "vapidPublicKey": "string"}
POST
/api/push/subscribe

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/push/subscribe" \  -H "Content-Type: application/json" \  -d '{    "endpoint": "string",    "keys": {      "p256dh": "string",      "auth": "string"    }  }'
{  "success": true,  "message": "string",  "preferences": {    "orders": true,    "menuItems": true,    "customers": true,    "callHistory": true  }}
POST
/api/push/unsubscribe

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/push/unsubscribe" \  -H "Content-Type: application/json" \  -d '{    "endpoint": "string"  }'
{  "success": true,  "message": "string"}
GET
/api/push/preferences

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Query Parameters

endpoint*string
Length1 <= length

Response Body

application/json

curl -X GET "https://example.com/api/push/preferences?endpoint=string"
{  "success": true,  "preferences": {    "orders": true,    "menuItems": true,    "customers": true,    "callHistory": true  }}
PUT
/api/push/preferences

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X PUT "https://example.com/api/push/preferences" \  -H "Content-Type: application/json" \  -d '{    "endpoint": "string",    "preferences": {}  }'
{  "success": true,  "message": "string",  "preferences": {    "orders": true,    "menuItems": true,    "customers": true,    "callHistory": true  }}