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
Key | Datatype | Required | Description |
---|---|---|---|
X-MAGICBELL-API-KEY | string | (Required) The (public) API key of your MagicBell project. | |
X-MAGICBELL-USER-EXTERNAL-ID | string | ID of the user. Provide the X-MAGICBELL-USER-EMAIL header instead if you identify users by email. | |
X-MAGICBELL-USER-EMAIL | string | Email address of the user. Provide the X-MAGICBELL-USER-EXTERNAL-ID header instead if you identify users by ID. | |
X-MAGICBELL-USER-HMAC | string | HMAC calculated with the API secret and ID, or email, of the user. Required if the project has HMAC enabled. | |
Content-Type | string | ||
Accept | string |
RESPONSES
status: Created
{"push_subscription":{"id":"\u003cstring\u003e","device_token":"\u003cstring\u003e","platform":"\u003cstring\u003e","app_bundle_id":"\u003cstring\u003e"}}