Can we query the timestamp of attaching a tag to a Topic? Like I want to sort the topics on the time when they were tagged with some tag.
סיכום מבוסס בינה מלאכותית
The discussion revolves around retrieving the timestamp when a tag was attached to a topic in Discourse. Minhaj asks if this information can be queried, particularly for sorting topics by tag-attachment time. Simon explains that the created_at field in the topic_tags table can be used via the Data Explorer plugin, but notes that this data is not available in the standard API response. Minhaj confirms the need for API access, and Simon clarifies that while the created_at field isn’t exposed directly in the API, it can be accessed by running a Data Explorer query through the API, with guidance provided in a related meta post.
It should be possible to get this information with the Data Explorer plugin. The time that a tag was added to a topic can be found from the created_at field of the topic_tags table. You’ll need to join the tags table to be able to find the tag by its name.
Thanks for suggesting plugin, but I need to fetch the information from the API.
I do not see any created_at field for tags when I query any topic information on sending GET request to discourseURL/t/{tid}.json. Can you suggest what I might be doing wrong here?
I don’t think the created_at parameter for tags is available anywhere in the Discourse JSON payload. You could write a Data Explorer query to get a tag’s created_at value and then run the query through the API. There are details about how to to that here: How to run Data Explorer queries with the Discourse API.