User Push Clients
List of valid attributes:
Attribute | Description | Specifics |
---|---|---|
endpoint | The push subscription endpoint URL | Required, must be a valid URL, unique, readable and writable |
keys | Authentication keys | Required, must be a JSON object with string values for keys ‘auth’ and ‘p256dh’, writable only |
Only the
endpoint
field is returned in responses. All other fields are writable but not readable.
Create
Example request:
{ "data": { "type": "push_client", "attributes": { "endpoint": "https://fcm.googleapis.com/fcm/send/abc123...", "keys": { "auth": "string-value", "p256dh": "string-value" } } }}
Example response:
{ "data": { "id": "e1b2c3d4-5678-1234-9abc-def012345678", "type": "push_client", "attributes": { "endpoint": "https://fcm.googleapis.com/fcm/send/abc123..." } }}
How it works
When registering a push client, the server ensures that each endpoint
is
unique for a user. If a push client with the same endpoint
already exists,
data will be updated with the new values provided. If no such push client
exists, a new one will be created.
HTTP Request
POST /api/v1/users/:user_id/push_clients
URL Parameters
Parameter | Description |
---|---|
user_id | The ID of the user to create the push client for |