Getting a post from its ID

I’m trying to get info about a post using:

curl -X GET "https://discourseExampleSite.com/posts/21?api_key=<api key>&api_username=<api username>

Although it gives me the entire html tag.

I know the post exists because when I get info about a topic and go under post_stream->posts I can see the post.

Can you help me out?

I figured it out

I needed to add .json to the end of the post id

Could you please add .json at the end of the post id in the documentation like for getting a topic

So:

image

Would become more like:

image

With a .json on the end

2 Likes