Register an FCM web-push token for the current account (ADR-018 Phase 6).
POST
/v1/notifications/push/register
const url = 'https://api.share2.us/v1/notifications/push/register';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"token":"example","platform":"web"}'};
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://api.share2.us/v1/notifications/push/register \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "token": "example", "platform": "web" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
token
required
FCM registration token for this browser.
string
platform
string
Responses
Section titled “Responses”Token registered.
Media typeapplication/json
object
registered
boolean
Examplegenerated
{ "registered": true}default
Section titled “default”Standard error envelope.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
request_id
required
string
Example
{ "error": { "code": "quota_exceeded" }}