Forum Discussion

mfeltscher's avatar
11 years ago

Fetch inactive polls from REST API

Hi there

 

Is it somehow possible to get a list of all inactive polls using the REST API? There is a call to get the active polls (as documented here) so in my opinions it should be possible for inactive posts too.

 

 

Moreno

  • mfeltscher, you can get the list of all the polls in your community using the call, /restapi/vc/polls and then from the returned xml, you can parse the following node to get the active status of the poll. If it is false, the poll is inactive. 

     

    <active type="boolean">false</active>

     

    I hope this helps.

  • mfeltscher, you can get the list of all the polls in your community using the call, /restapi/vc/polls and then from the returned xml, you can parse the following node to get the active status of the poll. If it is false, the poll is inactive. 

     

    <active type="boolean">false</active>

     

    I hope this helps.

    • mfeltscher's avatar
      mfeltscher
      Expert

      VarunGrazitti that is the way I'm doing it right now. I was afraid this could be the only way but not too surprised about it.. 

       

      I now have to fetch around 200 polls and filter them which is pretty slow as you can imagine. 

       

      Thank you anyways!

       

      Moreno

      • HaidongG's avatar
        HaidongG
        Lithium Alumni (Retired)

        Hi mfeltscher ,

         

        are you fetching the list from another website? if yes, you may consider to create an endpoint and leave all REST calls and filtering within the server. and there is only one call for you to retrieve the result via endpoint URL.