Get number of likes for a single post?

Hello,
I’m trying to get the number of likes for a single post via the API, but can’t seem to find it…

I see a like_count for the entire topic, but can’t seem to find the individual like count for each post in either /t/123.json or /posts/222.json.

I noticed that I can get a list of users who liked a post via /post_action_users.json and add them up manually, but what is the recommended way to to get the “like count” for an individual post?

Thanks!

I’m an idiot!
Found it under "actions_summary":

{"id":2,"count":5,"acted":true}

Well, hope this helps someone else!

오빠, 고마워! 정말 많이 도움이 돼!

불행히도 Discourse는 게시글에 좋아요가 없으면 해당 속성을 제거합니다.
또한 API 문서에도 포함되어 있지 않습니다: Discourse API Docs, Discourse API Docs

따라서 신뢰할 수 없으며, 불필요한 “속성 객체가 존재하는지” 확인 코드로 인해 코드가 오염됩니다.
최선을 다해 개선되어야 합니다.

피드백 감사합니다. 네, API 문서를 살펴보니 좋아요를 가져오는(fetching) 방법은 없고, 생성하는 것만 설명되어 있네요. 해당 부분을 중심으로 API 문서를 개선하는 것부터 시작하겠습니다.

정말 그 점에 대해 감사드립니다.
제가 이 부분에 도움이 될 수 있다면 (사람이 작성한 건가요?!) 알려주세요.
하지만 Discourse가 작성된 언어가 Ruby든 PHPdoc 같은 것을 사용하든, 아마도 그런 걸 쓰고 계신 것 같습니다.
저는 그 언어에 대해 경험이 없어서, 프로그래밍적인 부분이라면 아직 도움을 드리기 어렵습니다 :stuck_out_tongue:

50:50 정도라고 할 수 있습니다. 여전히 수작업이 필요하지만, rswag이라는 도구를 사용해 rspec 테스트에서 생성됩니다.