Forum Discussion

allensmith81's avatar
5 years ago

APIv2 Subscriptions Troubleshooting

Hi all,

 

I have been banging my head against a brick wall for about an hour now and it's either me (likely) or the Subscriptions API doesnt work.

I am trying to use a call like this:

Select count(*) from subscriptions where node.id =  'board:Boardid' 

 

The goal is to find out how many people have subscribed to that board or any of its children but it doesn't matter what I do I always get a 0 result unless I also pass in

subscriber.id = '<userid>'

 

what am I doing wrong here, surely I do not need to iterate through all of our users to find out how many subscribed?

 

 

  • Hi allensmith81 ,

    the API you are trying to use provides the results to the subscriptions of the user making the request unless there is a request containing the subscriber's ID explicitly.

    For Getting the subscribers to a particular board, you can try to use the V1 API to get the subscribes to a particular board:

     

    https://[COMMUNITY DOMAIN]/restapi/vc/boards/id/<board ID>/subscribers/email/board/count

    Documentation: https://developer.khoros.com/khoroscommunitydevdocs/docs/get-a-count-or-list-of-users-subscribed-to-a-board

    Please Give Kudos if you find this post useful and also mark this as Accepted Solution if this is the required solution.

    Regards

    Tarun Kumar

  • Meh,

     

    When will Khoros overhaul the APIs so we can have just one! lol

     

    Anyways - do you know if that APIv1 call also tells me how many people subscribed to the thread within that board or is it just how many people have subscribed to the board all up?