Skip to content

Example: Incoming text/markdown + plain

Let's say you want to save the following text/markdown content in a richtext field:

**this is the body text**

Additionally, let's say you also want to create a plain alternative of the text/markdown content. You then use the following Rich Text JSON:

{
  "type": "text/markdown",
  "encoding": "PLAIN",
  "content": "**this is the body text**",
  "createAdditional": "plain"
}

This saves a multipart/alternative MIME:

MIME-Version: 1.0
Content-Type: multipart/alternative; 
  boundary="XXXXboundary text"
--XXXXboundary text
Content-Type: text/markdown

**this is the body text**
--XXXXboundary text
Content-Type: text/plain

this is the body text
--XXXXboundary text--