This section gives an overview of the workflow for both Servers and Clients to work with Subscriptions. Each channel MAY vary slightly from this general overview - specifically around interactions involving the Endpoint (e.g., when using a rest-hook the client must pre-configure an HTTP endpoint which the server validates, but when using websockets the client simply connects to the server).
Creating a Subscription
A workflow for creating a subscription is below:
Server implements the core functionality required for subscriptions (see Conformance).
Server implements one or more SubscriptionTopic resources. Implementation is specific to each topic, and will vary between servers.
Client asks the server for the list of supported SubscriptionTopic resources, via querying the resource.
Client ensures that the endpoint is prepared (if applicable - see Channels).
Client requests a Subscription (e.g., via POST, PUT, etc.).
Server MAY accept the Subscription request (e.g., supported channel and payload).
Server MAY reject the Subscription request (e.g., unsupported channel type).
If applicable, the server MAY send a handshake to the endpoint.
If the Server sends a handshake, the endpoint should respond appropriately.
Once the subscription is active, notifications will be sent according to the Channel. Note that error states may occur, see Handling Errors for more information.