Register a device token for a user

POST {{baseUrl}}/push_subscriptions

Register a device token for push notifications.

Please keep in mind that mobile push notifications will be delivered to this device only if the channel is configured and enabled.

Request Body

{"push_subscription"=>{"device_token"=>"<string>", "platform"=>"<string>", "app_bundle_id"=>"<string>"}}

HEADERS

KeyDatatypeRequiredDescription
X-MAGICBELL-API-KEYstring(Required) The (public) API key of your MagicBell project.
X-MAGICBELL-USER-EXTERNAL-IDstringID of the user. Provide the X-MAGICBELL-USER-EMAIL header instead if you identify users by email.
X-MAGICBELL-USER-EMAILstringEmail address of the user. Provide the X-MAGICBELL-USER-EXTERNAL-ID header instead if you identify users by ID.
X-MAGICBELL-USER-HMACstringHMAC calculated with the API secret and ID, or email, of the user. Required if the project has HMAC enabled.
Content-Typestring
Acceptstring

RESPONSES

status: Created

{&quot;push_subscription&quot;:{&quot;id&quot;:&quot;\u003cstring\u003e&quot;,&quot;device_token&quot;:&quot;\u003cstring\u003e&quot;,&quot;platform&quot;:&quot;\u003cstring\u003e&quot;,&quot;app_bundle_id&quot;:&quot;\u003cstring\u003e&quot;}}