The API is not returning the post name value, with the name field showing null in the response. Jeremy_D is trying to fetch post details via the API, but it appears that the name field refers to the user’s name, not the post title. Arkshine clarifies that the name field is related to the user’s profile, and that the topic title is not returned in the initial response.
Jeremy_D is actually looking for the topic title, and has found a workaround by fetching a single topic and grabbing the first post in the post_stream. Arkshine explains that post_stream returns the first 20 posts by default, but can be limited using the ?page= query parameter. Additionally, a guide is provided for fetching specific posts. Jeremy_D is using the API to integrate Discourse posts into an Angular application, essentially creating a pseudo-blog.
There’s another value that I would think might contain the name of the post, user_title but that is also null. Is there a setting somewhere I’m missing? And yes these posts do in fact have titles.
Yep, with some extra poking, I was able to decipher how the api (and discourse) is supposed to work hierarchically. So now I’m fetching a single topic and just grabbing the first post in the post_stream.
Does post_stream return all posts on the topic? Or can I limit it in some way?
My use case is that I have an angular application and I’m trying to pull in Discourse posts to essentially make a pseudo-blog that’s integrated into that application. So far this seems entirely doable.