مشكلة في عنوان وواجهة برمجة تطبيقات الحصول على أحدث المواضيع

مرحباً،

نحن نستخدم منتدى Discourse ولدينا تجربة مستخدم مخصصة للتطبيق. نعتمد على واجهات برمجة التطبيقات (APIs) المتاحة للتفاعل مع Discourse. لا تتضمن تجربة المستخدم لدينا مفهوم العنوان يتبعه محتوى. فالفكرة الأساسية هي نشر المحتوى المدخل فقط. ولجعل ذلك يعمل بأسلوب Discourse، إذا قمت بوضع بعض الأحرف الأولية كعنوان والمحتوى الأصلي كنص خام في الجسم، فإنه عند جلب المواضيع الأحدث أو عند الحصول على قائمة بالمواضيع، سأحصل فقط على العنوان ولن أحصل على المنشور رقم 1 وهو المحتوى الفعلي. هل هناك حل أو تخصيص يمكنني إجراؤه للتغلب على هذه المشكلة؟

إعجاب واحد (1)

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 إعجابات

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