Subscribe to an extra view
Motivation
As a client, I want to add a subscription to an existing channel
Functional Design
- The client initiates PUT
/api/v2/apps/{owner}/{app}/notifications/{channelId}/workspaces/{wsid}/subscriptions/{entity}
- The subscription is added to the channel in addition to existing subscriptions, the client starts receiving notifications about changes in the specified entity.
- If the subscription already exists, it does nothing
| Key | Value |
|---|
| Content-Type | application/json |
| Authorization | Bearer {PrincipalToken} |
Parameters
| Parameter | Type | Description |
|---|
| Path | | |
| owner | string | name of a user who owns the application |
| app | string | name of an application |
| wsid | int64 | the ID of workspace |
| channelId | string | the ID of the channel, returned by create channel |
| entity | string | Subscription entity, see terms |
| Headers | | |
| PrincipalToken | string | Token returned by login |
Authorization
- If entity refers to a view, the client must have
read permission for that view in the specified workspace.
Result
Technical design
Components
~cmp.routerAddSubscriptionHandler~covrd1✅ function to handle the request in router
~err.routerAddSubscriptionInvalidToken~covrd2✅ if the token is invalid or expired
~err.routerAddSubscriptionNoPermissions~uncvrd3❓ if the client has no permissions to read from the specified view
Integration tests
~it.AddSubscription~covrd4✅