Skip to main content

Unsubscribe from a view

Motivation

As a client, I want to remove a subscription from an existing channel, so that I stop receiving notifications when a specified entity.

Functional Design

  • The client initiates DELETE /api/v2/apps/{owner}/{app}/notifications/{channelId}/workspaces/{wsid}/subscriptions/{entity}
  • The subscription is removed from the channel, the client stops receiving notifications about changes in the specified entity.

Request headers

KeyValue
Content-Typeapplication/json
AuthorizationBearer {PrincipalToken}

Parameters

ParameterTypeDescription
Path
ownerstringname of a user who owns the application
appstringname of an application
wsidint64the ID of workspace
channelIdstringthe ID of the channel, returned by create channel
entitystringSubscription entity, see terms
Headers
PrincipalTokenstringToken returned by login

Result

CodeDescriptionBody
204Unsubscribed
400Bad Requesterror object
401Unauthorizederror object
404Not Founderror object
429Too may requests, rate limitingerror object
500+Server errors / service unavailableerror object

Technical design

Components

  • ~cmp.routerUnsubscribeHandler~covrd1✅ function to handle the request in router
      • ~err.routerUnsubscribeInvalidToken~covrd2

Integration tests

  • ~it.Unsubscribe~covrd3

Footnotes

  1. [~server.n10n/cmp.routerUnsubscribeHandler~impl] pkg/router/impl_apiv2.go:163:impl

  2. [~server.n10n/err.routerUnsubscribeInvalidToken~impl] pkg/router/impl_apiv2.go:342:impl

  3. [~server.n10n/it.Unsubscribe~impl] pkg/sys/it/impl_n10n_test.go:91:impl