I’m trying to accurately gauge and report activity from a forum that I am running using Discourse. I think I fundamentally don’t understand what a Post is.
On the API, there’s Topics and Posts. For example, if I want to get Posts, I can use filter=5
As far as I can tell, the filter=5 for posts on /user_actions.json?offset=0&username=USERNAME&filter=5 does not correspond to the Posts in the report. It looks like the Posts on the report includes both the posts (filter=5) and topics (filter=4).
I’m assuming that posts are supposed to be replies + topics. It would be nice if someone more knowledgeable could confirm this.
If this is the case, I can try to use replies (filter 6) and topics (fliter 4). However, I’m a bit concerned about this as the report in the Discourse manager is giving the correct, expected numbers.
Try and search for an example of using the Discourse API to produce reports.
Yes, posts are within a topic. So searching for new posts will not search for new topics.
When you create a Topic you have also created a Post - the first Post is part of the Topic.
However, all subsequent Replies are also considered Posts - you are posting your replies.
As for the offset and whether the posts in the API are the same as in Admin → Reports → Posts, I’ll leave that to someone else.
That’s correct. All topics have a first post as part of the topic creation. One couldn’t very well create a topic with only a topic header. That first post isn’t counted as a post (reply) in a post query (filter-5).
When you query for posts, that’s a query for new Replies to Existing Topics - excluding the OP. That is the expected behavior - to show only the new posts.
To include Topics (created by that user) as part of the query, then Filter=4 should return the topics that user created (including the OPs as part of the count [3]), and their replies [4]. That would return the 7 you see in the report. 3 Topics created + 4 replies to give a count of 7 (3 OPs + 4 Replies).
Anyone else more knowledgeable please feel free to jump in.
@JimPas , thank you for your help. It is very useful. With this knowledge, I’m moving forward with the application dashboard with more confidence. Have a nice day. Very nice of you to help a stranger like me.