Skip to content

Commit

Permalink
typos and extra flags in curl not necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
ruffrey committed Jun 25, 2020
1 parent 52fbed1 commit 558cbef
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions getting_started/readmail.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,24 @@ Read Mail
To read a plain text email message you use the `text endpoint <https://mailsac.com/docs/api/#get-message-text>`_.
This endpoint can be accessed by :code:`GET /api/text/:email/:messageId`. You will substitute in the email address
the email was sent to and the message ID for that email. Using the values from the previous section will yield,
:code:`GET /api/text/user1%40mailsac.com:BotvTxaona7gLID1Adtpfj8Fnfi7HSSv-0`. The email message can be retrieved
using curl.
:code:`user1@mailsac.com` is the email address, and :code:`BotvTxaona7gLID1Adtpfj8Fnfi7HSSv-0` is the Mailsac messageId.

The email message can be retrieved using curl:

.. code-block:: bash
:caption: **Retrieve text of message**
curl -s -X GET https://mailsac.com/api/text/user1%40mailsac.com/Jn1wa9AwLigQwIbwUGyMMollJkeWSeUd-0
curl -H "Mailsac-Key: YOUR_API_KEY_HERE" https://mailsac.com/api/text/user1@mailsac.com/Jn1wa9AwLigQwIbwUGyMMollJkeWSeUd-0
.. literalinclude:: text_message
:language: text
:caption: **Plain text message**
:caption: **Plain text email message**

The :code:`/text/` portion of the URL can be replaced with other values, to retried different parsed representations of the
SMTP body.

- /text/ plaintext email body, or HTML parsed to plaintext
- /raw/ entire received SMTP message including headers, body, and attachments
- /body/ HTML body, with images, links and scripts scrubbed
- /dirty/ HTML body, with nothing scrubbed and images inlined
- /headers/ JSON object representation of SMTP headers. The key will be the header key, lowercased. When there are multiple headers with the same name, such as :code:`Received: ` header, the value of the header will be an array of strings. Otherwise the value will be a string.

0 comments on commit 558cbef

Please sign in to comment.