It’s easy to get all kinds of information about a post on a Discourse instance using the Discourse API. We can even get the entire text of a post as HTML in it’s “cooked” form. Is it possible, though, to get the original Markdown that was typed in to generate the post via the API?
סיכום מבוסס בינה מלאכותית
The original poster, mcmcclur, asked if it’s possible to get the original Markdown of a post via the Discourse API. Heliosurge suggested a theme component that adds a raw button, but mcmcclur clarified that they were looking for a solution using the API. Heliosurge shared alternative methods, but sam believed the answer was no, it’s not possible. However, sam then revealed that adding ?include_raw=true to the topic/SLUG/id.json endpoint includes the raw Markdown in the JSON response, which mcmcclur confirmed as the solution.
This Customization > Theme component will add a raw button
Thanks for the response. My question, though, is can I access the original Markdown via the Discourse API?
I am not sure with the API but this is another method of getting raw post.
And a topic with similar request.
I think you are talking about the topic/SLUG/id.json endpoint?
If so, then by adding ?include_raw=true to the endpoint the JSON for the posts in the topic will include raw.
Yes, that does it exactly - thanks Sam!!