Forum Discussion

PerBonomi's avatar
9 years ago

Correct Reply Count with API 2

Scenario: One Topic with two replies. First reply was, obviously, a reply to the OP. Second reply was a reply to the first reply.   Using the original API(/threads/id/<id>/replies/count) I get: ...
  • cike's avatar
    9 years ago

    PerBonomi VarunGrazitti Using APIv2 you could query for the message count of the whole conversation:

     

    SELECT conversation.messages_count FROM messages WHERE id = '<id>' AND depth = 0

    The conversation.messages_count includes the original post. To get the count of all replies only you could simply do something like

     

    <#assign true_reply_count = (messages_count?number - 1) />

     

    Kind regards,

    Christian