Forum Discussion

ricardo_cardoso's avatar
3 years ago

API call to see how many posts dont have an answer

 Hey,

Can anyone give me an API call I can make to get:

Number of posts in board Y posted since XX/XX/XXXX with 0 replies.

Thank you so much,

RC

  • SuzieH's avatar
    SuzieH
    Khoros Alumni (Retired)

    I'm wondering if you could do something like this? 

    SELECT count(*) FROM messages where depth=0 AND conversation.solved=false AND AND board.id = 'myCoolBoard' conversation.last_post_time > date_rang_start AND conversation.last_post_time < date_range_end

     

    This should give you the count of topics from unsolved threads by board and last topic post time

    Both my local and QA environment is down at the moment, so I'm not able to test this at this time unfortunately.

    Alternatively to SELECT count(*), I think you could do SELECT id and then use the result count as your topic count. If you go that route, you should include a SORT like ORDER BY conversation.last_post_time DESC.