이 엔드포인트는 지정된 게시글을 포함하여 정보를 반환한다고 약속합니다. 예를 들어:
○ → curl -s 'https://meta.discourse.org/t/fkb-pro-social-theme/234323.json?post_number=40' | jq .post_stream.posts[].post_number
33
34
35
36
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
싱글 페이지 애플리케이션(SPA)인 Discourse는 작업을 최소화하기 위해 API를 효율적으로 사용합니다. 게시글 하나당 API 호출을 한 번씩 하는 것은 합리적이지 않습니다. 그렇게 하면 클라이언트와 서버 간의 왕복 통신량이 기하급수적으로 늘어날 것입니다.
결과에서 원하는 게시글을 선택하는 것은 매우 간단합니다. 위와 마찬가지로, 40번 게시글의 cooked 콘텐츠만 가져오는 경우:
○ → curl -s 'https://meta.discourse.org/t/fkb-pro-social-theme/234323.json?post_number=40' | jq -r '.post_stream.posts[] | select(.post_number == 40) | .cooked'
<p>Hi Tiago,</p>
<p>Can you please clarify it a little bit? Some screenshots, your actual code and where is your advert appear would be very helpful. Thank you <img src="https://emoji.discourse-cdn.com/twitter/slightly_smiling_face.png?v=12" title=":slightly_smiling_face:" class="emoji" alt=":slightly_smiling_face:" loading="lazy" width="20" height="20"></p>
또는, 쿼리 중인 단일 게시글에 대한 정보만 반환하는 것이 절대적으로 필요하다면, 그렇게만 하는 Data Explorer 쿼리를 작성하는 것이 가능합니다.