mailpit.client.api module¶
module containing API related
- class mailpit.client.api.API(mailpit_url: str, timeout: int | None = None)¶
Bases:
object
class representing the different endpoints of the API
- MESSAGES_ENDPOINT = 'api/v1/messages'¶
- MESSAGE_ENDPOINT = 'api/v1/message'¶
- delete_messages(ids: List[str])¶
send a DELETE request to delete messages
- Parameters:
ids – the IDs of the messages to delete; NOTE: passing an empty list will delete all messages
- get_message(message_id: str) Message ¶
Send a GET request to get a certain Message by its Message-ID
- Parameters:
message_id – The Message-ID to get the message by
- get_message_attachment(message_id: str, part_id: str) str ¶
Send a GET request to the message endpoint with querying for the part_id of an attachment
- Parameters:
message_id – the Message-ID the attachment belongs to
part_id – the Part-ID of the attachment to receive
:return the attachment’s data
- get_message_headers(message_id: str) Headers ¶
Send a GET request to get a message’s Headers
- Parameters:
message_id – The Message-ID to get the headers for