This section provides a reference for APIs that should be implemented by this Building Block.
This section provides a reference for APIs that should be implemented by this Building Block. The APIs defined here establish a blueprint for how the Building Block will interact with other Building Blocks. Additional APIs may be implemented by the Building Block, but the listed APIs define a minimal set of functionality that should be provided by any implementation of this Building Block.
The GovStack non-functional requirements document provides additional information on how 'adaptors' may be used to translate an existing API to the patterns described here. This section also provides guidance on how candidate products are tested and how GovStack validates a product's API against the API specifications defined here.
The tests for the Messaging Building Block can be found in this GitHub repository.
This API is designed to send out emails one by one.
Although an email can be sent to multiple recipients by using email
, emailCC
and emailBCC
appropriately, this is still considered as sending a single email.
As a Doctor working in a hospital, I want to notify my patient about a confirmed registration so that the patient would know when to come for a visit.
This API is designed to send out identical emails to multiple (batch) recipients at once.
As a Hospital I want to notify a specified group of my clients about the possibility to register to vacant time slots within a limited period of time so that the clients potentially needing it the most would have a guaranteed chance to get an appointment
This API is designed to accept responses to emails that have been previously sent out by using the Messaging Building Block. The protocol itself is lightweight and expects custom services from anyone using it. The Messaging Building Block is responsible for delivering the message and does not know (or want to know) anything about the content of it, how it will be used, etc.
As a Hospital, I want to get and send responses from and to clients so that I could continue and keep track of email conversations taking place via GovStack
This API is designed to provide information about the status of emails sent to the Messaging Building Block.
As a Doctor working in a hospital I want to know which emails I have sent haven't reached their destination so that I could contact such patients by using different means
Possible status of emails that can be queried are as follows:
scheduled
processing
deferred
bounced
not sent
delivered
There is no keeping track of emails which have been sent successfully, as this would end up creating and maintaining a massive database of emails, their senders and recipients, etc., which would be wrong for so many reasons.
This service may reside on both Messaging BB's and client's side. If used, a matching OpenAPI spec must be provided by the service provider, describing the expected input when making request to the endpoint.
Email containing information about the recipient
"Meta-info"
"Q2xpZW50LXNwZWNpZmljIGNvbnRlbnQsIG1vc3QgbGlrZWx5IEpTT04="
Request successfully accepted
Get status of sent emails. Use both "apiKey" and "requestUid" in your request.
Select status values to fetch data for
Request successfully accepted
0
1004
0
257
0
9032
When sending batch emails, recipients information is passed in base64 format. Sender information and email content must be the same for all recipients.
Email containing information about the recipient
"https://example.com/callback/emails/requestUid"
"Example Medical Insitution"
"GOV1234567890"
"Example Medical Insitution"
"GOV1234567890"
"sender@example.com"
"reply-to@example.com"
"Example Doctor"
"W3sKCSJyZWNpcGllbnRJbmZvIjogewoJCSJlbWFpbCI6ICJjdXN0b21lckBleGFtcGxlLmNvbSIsCgkJImVtYWlsQ0MiOiAiY3VzdG9tZXItY2NAZXhhbXBsZS5jb20iLAoJCSJlbWFpbEJDQyI6ICJjdXN0b21lci1iY2NAZXhhbXBsZS5jb20iLAoJCSJuYW1lIjogIkV4YW1wbGUgQ3VzdG9tZXIiCgl9Cn0sIHsKCSJyZWNpcGllbnRJbmZvIjogewoJCSJlbWFpbCI6ICJkZWFyLWN1c3RvbWVyQGV4YW1wbGUuY29tIiwKCQkibmFtZSI6ICJVbmtub3duIEN1c3RvbWVyIgoJfQp9XQ=="
"UTF-8"
"Example Title Of An Email"
"Example Customer"
Request successfully accepted
"Request successfully accepted. Use \\\"requestUid\\\" to track it's status."
"UfQK-CPju-Ea5B-6y7X-8A72-VqU5"
Email containing information about the recipient
"https://example.com/callback/emails/requestUid"
"Example Medical Insitution"
"GOV1234567890"
"Example Medical Insitution"
"GOV1234567890"
"sender@example.com"
"reply-to@example.com"
"Example Doctor"
"customer@example.com"
"customer-cc@example.com"
"customer-bcc@example.com"
"Example Customer"
"UTF-8"
"Example Title Of An Email"
"Example Customer"
Request successfully accepted
"Request successfully accepted. Use \\\"requestUid\\\" to track it's status."
"UfQK-CPju-Ea5B-6y7X-8A72-VqU5"