Wow, you are right, it works ![]()
And I figured out how to retrieve the ID of the first post in a topic using the Discourse API:
async function getFirstPostIdFromOnetopic(topic_id) {
const Discourse_API_Key = "Discourse_API_Key";
const url = `https://discourse.mysite.com/t/${topic_id}/posts.json`;
const response = await fetch(url, {
method: 'GET',
headers: {
"Api-Key": Discourse_API_Key,
"Api-Username": "system",
"Content-Type": "application/json",
}
});
const data = await response.json();
const firstPostId = data.post_stream.posts[0].id;
return firstPostId;
}
Thank you and @Lilly ![]()