Description
Add endpoint to receive content from Content Watcher Service. Content Watcher Service allows to register a webhook that it calls when a new event is produced and sends the contents of those events.
Acceptance Criteria
[ ] Implement a Post endpoint /v2/webhook/broadcast to receive message.
[ ] Ensure messages are stored for retrieval
Technical Specs:Endpoint URL: POST /v2/webhooks/broadcast
Purpose: To receive and process broadcast messages from the Content Watcher Service.
Body:
schemaId (integer): Identifier for the schema version.
announcement (object): Contains the details of the broadcast message, including:
-- fromId (string): The identifier of the sender.
-- contentHash (string): Hash of the content being broadcasted.
-- url (string): URL where the broadcasted content can be accessed.
-- announcementType (integer): The type of announcement being made.
All properties within the announcement object are required for a valid request.
Expected Responses:
201 Created: Indicates that the broadcast message was successfully received and processed.
Error Responses: Implement appropriate error responses for various scenarios, such as 400 Bad Request for invalid payloads, 401 Unauthorized for unauthenticated requests, and other relevant HTTP status codes for error states encountered by the endpoint.
Security Measures: Implement verification mechanisms to authenticate the source of the webhook calls.
Description Add endpoint to receive content from Content Watcher Service. Content Watcher Service allows to register a webhook that it calls when a new event is produced and sends the contents of those events.
Acceptance Criteria
/v2/webhook/broadcast
to receive message.Technical Specs:
Endpoint URL:
POST /v2/webhooks/broadcastPurpose:
To receive and process broadcast messages from the Content Watcher Service.Body:
schemaId (integer):
Identifier for the schema version.announcement (object):
Contains the details of the broadcast message, including: --fromId (string):
The identifier of the sender. --contentHash (string):
Hash of the content being broadcasted. --url (string):
URL where the broadcasted content can be accessed. --announcementType (integer):
The type of announcement being made. All properties within the announcement object are required for a valid request.Expected Responses:
201 Created:
Indicates that the broadcast message was successfully received and processed.Error Responses:
Implement appropriate error responses for various scenarios, such as 400 Bad Request for invalid payloads, 401 Unauthorized for unauthenticated requests, and other relevant HTTP status codes for error states encountered by the endpoint.Security Measures:
Implement verification mechanisms to authenticate the source of the webhook calls.References![Image](https://github.com/AmplicaLabs/dsnp-gateway-prototype/assets/3433442/396c9887-f6f8-4fa2-a9d1-c39c1a7c561a)
Open API Spec