Raw Post Body for POST API

Is there a way to view an existing post I’ve created and what that looks like if I want to use it for a a template when making a POST api request with the “raw” field?

Thanks!

1 Like

There are probably many ways of doing this like using the chrome dev tools, looking in the db, but here is one way: If you can get the post id which you can do by going to the topic url and append .json. For example this topic:

https://meta.discourse.org/t/raw-post-body-for-post-api/85128.json

Then you can get the post id from the json:

{"post_stream":{"posts":[{"id":409746,

Then go to:

https://meta.discourse.org/posts/409746.json

and you can see the ‘raw’ field:

“Is there a way to view an existing post I’ve created and what that looks like if I want to use it for a a template when making a POST api request with the "raw" field?\n\nThanks!”

5 Likes

Love it. Thank you!!

This topic was automatically closed after 2249 days. New replies are no longer allowed.