armingrudd
(Armin Ghassemi Rudd)
February 20, 2024, 8:17am
1
Hi,
Is it possible to get the posts (IDs) that user has viewed? The use case here is to filter topics within a timeframe and count viewed topics in the custom timeframe.
Since “post read” is one of the user statistics in /u, I thought it should be possible to get that in a custom timeframe as well.
2 Likes
Lilly
February 20, 2024, 1:44pm
2
Have you had a look through the rest API documentation?
Discourse API
Please view the Discourse API Documentation site for detailed info:
https://docs.discourse.org
Deprecation Warning!
On April 6th, 2020 we dropped support for all non-HTTP header based authentication (excluding some rss, mail-receiver, and ics routes). This means that API requests that have an api_key and api_username in the query params or in the HTTP body of the request will soon stop working. Please see the example cURL request below for how to update your API re…
Discourse is backed by a complete JSON api. Anything you can do on the site you can also do using the JSON api.
Many of the endpoints are properly documented in the discourse_api gem, however some endpoints lack documentation.
To determine how to do something with the JSON API here are some steps you can follow.
Example: recategorize a topic.
Go to a topic and start editing a category:
[image]
Open Chrome dev tools, switch to the Network tab, select XHR filter:
[image]
Perform the o…
There are several guides covering various API uses or explanations.
This one gives practical and comprehensive examples on how to use it.
All code examples in this guide aren’t meant to display good practice or to be used as they are.
A lot of checks, error handling and so on are purposely ignored or skipped to focus purely on the API’s usage.
What is the API used for?
Most of your actions in Discourse (posting, liking, editing a setting, etc.) are done using the API by making re…
Also Data Explorer queries
5 Likes