Meilleure API pour tous les premiers messages dans une catégorie

We want to get all of the first posts in a category (which we are using as wikis but not actually wikis).

Preferably, we’d like to avoid having to do one request per topic/post.

The best way have so far is using search to get topics, and then get the topics one by one and take the first post out of the stream.

Web hooks will be a good option in the future but we’d like to start with PULL.

thanks!

1 « J'aime »

Bumping this to see if anyone had an idea?

I’m not aware of a bulk way of getting the first replies to many topics. Iterating through each topic and grabbing the first post is probably the best option.

Yes, webhooks really are a good option here and you can trigger off the “Post Event”.

But this would trigger for EVERY post event and you’d just have to ignore all the posts that aren’t the first reply on a topic.

2 « J'aime »

Could you write a data-explorer query that returns the data that you want, and then execute that query via the API?

2 « J'aime »

@blake

image

I don’t suppose the topic event would include changes to the OP?

1 « J'aime »

It should trigger for changes. The description for it says:

When there is a new topic, revised, changed, or deleted.

Yes, that is great option! :slight_smile:

Salut tout le monde,

Je développe une application mobile qui s’intègre à notre instance Discourse auto-hébergée. J’ai besoin de récupérer tous les premiers messages des sujets dans une catégorie spécifique, similaire au cas d’utilisation discuté ici.

Bien que l’approche actuelle consiste à récupérer les sujets, puis à récupérer individuellement chaque premier message, je recherche une méthode plus efficace adaptée aux applications mobiles. Idéalement, cela minimiserait le nombre d’appels API pour économiser la bande passante et améliorer les performances.

Quelqu’un a-t-il mis en œuvre une solution similaire ou peut offrir des conseils sur la manière la plus efficace d’y parvenir ? Toutes les idées ou suggestions seraient grandement appréciées !

1 « J'aime »

Je pense que la route de la requête de l’explorateur de données mentionnée ci-dessus mériterait d’être essayée. De cette façon, vous pourriez faire une requête par catégorie.