Get the push public key
GET
/api/v1/notifications/vapid/public-key
const url = 'https://example.com/api/v1/notifications/vapid/public-key';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/api/v1/notifications/vapid/public-key \ --header 'Authorization: Bearer <token>'Return the public key that a browser uses to create a push subscription. The response does not include the private key. Route: /api/v1/notifications/vapid/public-key. Inputs: . Safe reads can use bounded retries.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”Media typeapplication/json
object
public_key
required
URL-safe, unpadded VAPID public key for browser subscription setup.
string
Examplegenerated
{ "public_key": "example"}Media typeapplication/json
The standard API error response: { "error": { ... } }.
object
Example
{ "error": { "code": "bad_request" }}Media typeapplication/json
The standard API error response: { "error": { ... } }.
object
Example
{ "error": { "code": "bad_request" }}