You're integrating with a fictional email provider called FakeMail. It emits webhooks when new emails arrive, and provides a REST API for fetching those emails. Your job is to implement an email processor application.
The way the webhook works is a little bit special. FakeMail doesn’t provide the email data in the webhook payload. Instead, here’s how it’s intended to work:
watch endpoint to get the current history_id .history_id . This means that all emails up until and including that history_id are ready for processingImplement:
POST /webhook) that fetches new email IDs and processes them via the API/results/<email_id>) that returns a processed email classificationProcessing means:
/classify endpoint with that email's contentsemail_id and its classification resultNote that you have been provided the request schemas, but not the response. This is intentional - we want to see you play around with the API to figure out how it works.
POST /watch