lemmy.yachts
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
KaKi87@jlai.lu to Lemmy Support@lemmy.ml · 1 day ago

Why the API says a post doesn't have comments when the HTML page shows comments ?

message-square
message-square
5
fedilink
8
message-square

Why the API says a post doesn't have comments when the HTML page shows comments ?

KaKi87@jlai.lu to Lemmy Support@lemmy.ml · 1 day ago
message-square
5
fedilink

Hi,

This post has comments : https://jlai.lu/post/26123233

But when asking the API : https://jlai.lu/api/v3/comment/list?post_id=26123233&sort=Old

An empty array is returned.

Why ?

Thanks

  • KaKi87@jlai.luOP
    link
    fedilink
    arrow-up
    2
    ·
    1 day ago

    Thanks.

    Now, why isn’t that required for an older post ?

    For example : https://lemmy.world/api/v3/comment/list?post_id=5&sort=Old

    • Arthur Besse@lemmy.ml
      link
      fedilink
      English
      arrow-up
      1
      ·
      22 hours ago

      i’m guessing it might have something to do with the fact that jlai.lu is configured to default to the Local view while lemmy.world defaults to All

      • KaKi87@jlai.luOP
        link
        fedilink
        arrow-up
        2
        ·
        22 hours ago

        Interesting, thanks !

    • Dessalines@lemmy.mlM
      link
      fedilink
      arrow-up
      3
      ·
      1 day ago

      Read the API docs for what type means: https://join-lemmy.org/lemmy-js-client-docs/v0.19/classes/LemmyHttp.html#getComments

Lemmy Support@lemmy.ml

lemmy_support@lemmy.ml

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]

Support / questions about Lemmy.

Matrix Space: #lemmy-space

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 4 users / day
  • 32 users / week
  • 112 users / month
  • 493 users / 6 months
  • 1 local subscriber
  • 4.97K subscribers
  • 524 Posts
  • 1.48K Comments
  • Modlog
  • mods:
  • Dessalines@lemmy.ml
  • BE: 0.19.7
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org