Melhor API para todos os primeiros posts em uma categoria

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 curtida

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 curtidas

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

2 curtidas

@blake

image

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

1 curtida

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:

Olá a todos,

Estou desenvolvendo um aplicativo móvel que se integra à nossa instância Discourse auto-hospedada. Preciso recuperar todas as primeiras postagens de tópicos dentro de uma categoria específica, semelhante ao caso de uso discutido aqui.

Embora a abordagem atual envolva buscar tópicos e, em seguida, recuperar cada primeira postagem individualmente, estou procurando um método mais eficiente adequado para aplicativos móveis. Idealmente, isso minimizaria o número de chamadas de API para economizar largura de banda e melhorar o desempenho.

Alguém implementou uma solução semelhante ou pode oferecer orientação sobre a maneira mais eficiente de conseguir isso? Quaisquer insights ou sugestões seriam muito apreciados!

1 curtida

Acho que a rota de consulta do explorador de dados mencionada acima valeria a pena tentar. Dessa forma, você poderia fazer uma solicitação por categoria.