Hermes API URL End Points¶
-
DELETE/subscribe/(string: subscriber_id)¶
-
DELETE/subscribe¶ Delete a subscriber from the database.
- Args:
- subscriber_id (str): The ID for the subscriber to be deleted.
- Returns:
- The amazon dynamodb response.
-
GET/subscribe/(string: subscriber_id)¶
-
GET/subscribe¶ Get a subscriber’s info from the database.
- Args:
- subscriber_id (str): The ID for the desired subscriber.
- Returns:
- The amazon dynamodb response.
-
PUT/subscribe/(string: subscriber_id)¶
-
PUT/subscribe¶ Add a new subscriber. Parse the given arguments to check it is a valid subscriber. Assign the subscriber a uuid in hex that is used to identify the subscriber when wishing to delete it. Does not use the subscriber_id argument.
Arguments are passed in the request data.
- Args:
first_name (str): Required. The subscriber’s first name.
last_name (str): Required. The subscriber’s last name.
email (str): Required. The subscriber’s email address.
- country (str): Required. The country that the subscriber has signed
- up to.
sms (str): The subscribers phone number for sms.
slack (str): The slack username/channel. topics ([str]): Required. The ID’s for the topics to which the
subscriber wishes to subscribe.- verified (str): Are their contact details verified? Defaults to
- False. str is resolved to boolean.
- Returns:
- The amazon dynamodb response, with the assigned subscriber_id.
-
PUT/publish¶ Publish a message to a given topic set. All subscribers with subscriptions to any of those topics are to receive the message. First parse the given arguments to check it is a valid email.
Arguments are passed in the request data.
- Args:
- id (str): Required. If another message with the same ID has been
- logged, this one won’t send. Returns a 400 Bad Request error if this is the case.
message (str): Required. The message.
- topics ([str]): Required. The topics the message fits into
- (determines destination address/es). Accepts array of multiple topics.
- medium ([str]): The medium by which to publish the message
- (‘email’, ‘sms’, etc…) Defaults to email. Accepts array of multiple mediums.
- sms-message (str): The sms version of the message. Defaults to the
- same as ‘message’
- html-message (str): The html version of the message. Defaults to
- the same as ‘message’
subject (str): The e-mail subject. Defaults to “”.
from (str): The address from which to send the message.
Deafults to an emro address stored in the config.- Returns:
- An array of amazon SES and nexmo responses for each message sent.
-
GET/notify¶ Notify the developers on slack of some change in the system. This is a GET endpoint that can be used by services like Read The Docs to update developers. All args are passed as GET args. Note that the auth token can be included in the get args.
- Args:
message (str): Required. The slack message.
subject (str): Required. The message title.
- Returns:
- The amazon SES response.
-
PUT/notify¶ Notify the developers of some change in the system. Notifications are automatically sent to slack. These messages are not subject to the rate limiting that normal published messages are subject to.
- Args:
message (str): Required. The e-mail message.
subject (str): Optional. Defaults to “Meerkat Notice”.
- medium ([str]): Optional. A list of the following mediums: ‘email’,
- ‘sms’, ‘slack’. Defaults to [‘slack’].
- sms-message (str): Optional. The sms version of the message.
- Defaults to the same as ‘message’
- html-message (str): Optional. The html version of the message.
- Defaults to the same as ‘message’
- Returns:
- The amazon SES response.
-
POST/verify/(string: subscriber_id)¶
-
POST/verify¶ Given a verify code, this method returns a boolean saying whether the given code matches the stored code.
Arguments are passed in the request data.
Post args: subscriber_id (str): Required. The ID for the subscriber who has been verified. code (str): Required. The code to be checked.
- Returns:
- A json blob with one boolean attribute “matched” saying whether the codes have matched. e.g. {“matched”: true}
-
GET/verify/(string: subscriber_id)¶
-
GET/verify¶ Sets the subscriber’s “verified” attribute to True.
- Args:
- subscriber_id (str): The ID for the subscriber who has been verified.
- Returns:
- A json object with attribute “message” informing whether the verificaiton was successful e.g. {“message”:”Subscriber verified”}
-
PUT/verify/(string: subscriber_id)¶
-
PUT/verify¶ Puts a new verify code into the verify attribute. This can then be checked using the post method and provides a generic means of verifying contact details for any communication medium.
Arguments are passed in the request data.
- Args:
- subscriber_id (str): Required. The ID for the subscriber who has
- been verified.
- code (str): Required. The new code to be stored with the
- subscriber.
- Returns:
- The amazon dynamodb response.
-
PUT/email¶ Send an email with Amazon SES. First parse the given arguments to check it is a valid email. !!!Remember that whilst still in AWS “Sandbox” we can only send to verified emails.
Arguments are passed in the request data.
- Args:
subject (str): Required. The e-mail subject.
message (str): Required. The e-mail message.
email (str): The destination address/es for the e-mail.
subscriber_id (str): The destination subscriber/s for the e-mail.
- html (str): The html version of the message, will default to the
- same as ‘message’.
- from (str): The sender’s address. Defaults to the config value
- SENDER.
- Returns:
- The amazon SES response.
-
PUT/error¶ Notify the developers of an error in the system. Error notifications can be posted to slack and sent out via email and text. These messages are not subject to the rate limiting that normal published messages are subject to.
- Args:
message (str): Required. The e-mail message.
subject (str): Optional. Defaults to “Meerkat Error”.
- medium ([str]): Optional. A list of the following mediums: ‘email’,
- ‘sms’, ‘slack’. Defaults to [‘slack’,’email’].
- sms-message (str): Optional. The sms version of the message.
- Defaults to the same as ‘message’
- html-message (str): Optional. The html version of the message.
- Defaults to the same as ‘message’
- Returns:
- The amazon SES response.
-
PUT/sms¶ Send an sms message with Nexmo. First parse the given arguments to check it is a valid sms.
Arguments are passed in the request data.
- Args:
sms (str): The destination phone number.
message (str): The sms message.
- Returns:
- The Nexmo response.
-
PUT/gcm¶ Send an GCM message First parse the given arguments to check it is a valid GCM message.
Arguments are passed in the request data.
- Args:
message (str): Required. The message payload.
- destination (str): Required. Destination subscriber id or topic for
- the message.
- Returns:
- The Google Cloud Messaging server response.
-
GET/¶ Display something at /. This method loads a dynamodb table and displays its creation date.
-
POST/unsubscribe/(string: subscriber_id)¶ Actually performs the deletion.
- Args:
- subscriber_id (str): The ID for the subscriber to be unsubscribed.
- Returns:
- The amazon dynamodb response.
-
GET/unsubscribe/(string: subscriber_id)¶ Returns a page that allows the user to confirm they wish to delete their subscriptions
- Args:
- subscriber_id (str): The ID for the subscriber to be unsubscribed.
- Returns:
- The amazon dynamodb response.
-
DELETE/log/(string: log_id)¶ Delete a log record from the database.
- Args:
- log_id (str): for the record to be deleted.
- Returns:
- The amazon dynamodb response.
-
GET/log/(string: log_id)¶ Get message log records from the database.
- Args:
- log_id (str): The id of the desired message log.
- Returns:
- The amazon dynamodb response.