Synapse Subscription Services

Synapse Subscription Services

An important requirements for Synapse Discussion Forum is notifying users when important events happen. For example, a moderator receives notifications when someone posted a question on his/ her forum. An author receives notifications when someone answered to his/ her question.

In early discussion about notifications for Discussion Forum, we recognize that this kind of notifications is different from the Synapse Email Services that we have. In this case, users may want to subscribe to a topic or an object in Synapse and received notifications when something changed within this topic/ object. When receiving notifications about the events, user may or may not want to take any action. Users should also be able to choose the type of notifications they would like to receive, and be able to unsubscribe to a topic/ object and still receive notifications about events that happen around another topic/ object.

Mockups

User has not subscribe/ watch this thread and this forum.



User who subscribed/ watching this thread and this forum.



User logged in to unsubscribe/ stop watching this thread.



Models

API



Action

Intended User

URI

Method

Request Params

Request Body

Response Body



Action

Intended User

URI

Method

Request Params

Request Body

Response Body

1

subscribe to a topic

Synapse users who has READ permission on the object

/subscription

POST



Topic

Subscription

2

retrieve subscriptions a user has for a given list of topics

Synapse users

/subscription/list

POST



SubscriptionRequest

SubscriptionPagedResults

3

unsubscribe to a topic

Synapse users who created this subscription

/subscription/{subscriptionId}

DELETE







4

retrieve all subscriptions for a user

Synapse users

/subscription/all

GET

limit, offset, objectType (optional)



SubscriptionPagedResults

5

retrieve a subscription

Synapse users who created this subscription

/subscription/{subscriptionId}

GET





Subscription

6

retrieve subscribers for a topic

Synapse users

/subscription/subscribers

POST

nextPageToken

Topic

SubscriberPagedResults

7

retrieve number of subscribers for a topic

Synapse users

/subscription/subscribers/count

POST



Topic

SubscriberCount

8

subscribe to all topics with the same SubscriptionObjectType

Synapse users

/subscription/all

POST

objectType



Subscription

SubscriberPagedResults

SubscriberPagedResults

String nextPageToken

List<String> subscribers

SubscriberCount

SubscriberCount

long count