Getting a post from its ID


(Mike Wood) #1

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?


(Mike Wood) #2

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