Forum Discussion

bhupen's avatar
bhupen
Advisor
11 years ago

Is there a way to export more than 25 unique usernames in csv/txt

I want to export a list of unique usernames for any given thread identified.

Solution I had:
 I have managed it using REST API with this call:
 /restapi/vc/threads/id/23/participants/recent.
 
Concern:
 This solutino is only giving me 25 user in output where as there are many users in the thread.
 Can someone help me out for this please

Help will be appreciated.

 

Regards

  • bhupen's avatar
    bhupen
    11 years ago
    samudhraa Thank you very much. I resolved this using this:
    <#assign x=10>
    <#list 1..x as pageNum>
    <#list restadmin("/threads/id/5719/participants/recent/?page=${pageNum}&page_size=1000").users.user as user>
    <#if user.login??>
    ${user.login}
    </#if>
    </#list>
    </#list>
  • Hi bhupen ,

     

    I was just wondering if you have used paging in your rest call. The usual REST result is 25 items (nodes) per page.You can use page size and page numbner to page through your results. Here is an example .

     

    /restapi/vc/threads/recent?page=1&page_size=50

     

    page_size - specifies the number of items per page.

    page         - specifies the page number.

     

    So in this example , I am asking for 50 thread items per page.You can keep iterating the page number and get the total list .

    If you are using a custom component , then there is a separate components for pagination which might be of use to you.

     

    Hope that helps.

     

    Thanks,

    Sam

     

    • bhupen's avatar
      bhupen
      Advisor

      Hi samudhraa  Thanks for your reply.

       

      your trick works for me at halfway:
      /restapi/vc/threads/recent?page=1&page_size=50

       

      Now I have one more concern, we can set only page_size =<1000. But In my case there is more than 1050 pages and also i can't make pagination for records because iam exporting the user in csv format. I am using edpoints and downloading it in csv format.

       

      Now Iam able to export 1000 user only but my thread contains more than 14000 user and 1050 pages.

       

      Help is appreciated.

       

      Regards

      Bhupen

       

       

      • bhupen's avatar
        bhupen
        Advisor

        Hi,

        Now I got the solution for this, but its not complete yet. I can export the user using below REST API but the concern is I have to change the page number "page=1&page_size=1000" inside endpoints, so how can I change page number dynamically inside endpoints.

         

        <#list restadmin("/threads/id/${RequestParameters.id}/participants/recent/?page=1&page_size=1000")

         

        Regards