Problem mit Titel und API zum Abrufen der neuesten Themen

Hallo,

wir nutzen das Discourse-Forum und haben eine angepasste Benutzeroberfläche für die Anwendung entwickelt. Für die Interaktion mit Discourse verwenden wir die bereitgestellten APIs. Unsere Benutzeroberfläche kennt das Konzept eines Titels gefolgt von einem Inhalt nicht. Stattdessen muss nur der eingegebene Inhalt veröffentlicht werden. Wenn ich, um es im Discourse-Stil funktionsfähig zu machen, einige Anfangszeichen als Titel verwende und den ursprünglichen Inhalt als Rohdaten im Body hinterlege, erhalte ich beim Abrufen der neuesten Themen oder bei einer Themenliste nur den Titel, nicht aber den ersten Beitrag (Post #1), der meinen eigentlichen Inhalt darstellt. Gibt es eine Lösung oder eine Anpassungsmöglichkeit, um dieses Problem zu beheben?

1 „Gefällt mir“

This is what is returned by the Discourse topic lists. I don’t think the lack of a proper title is what is causing the problem. To get actual post content from a topic list, you need to make two API requests. First make an API request to get the topic list. Then from the topics that are returned, you need to get the topic ids and make a request to /t/<topic_id>.json for each topic. Substitute the id of the topic you want for <topic_id>. This second request will return the first 20 posts in the topic.

4 „Gefällt mir“

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.