2 Replies Latest reply on Aug 9, 2017 12:37 PM by Aqeel Burhani

    Pull Users using rest api

    Aqeel Burhani

      I am trying to pull the list of users from our on-prem community using a simple script with curl command. I am not able to pull more than 11K users. I am not getting any errors. Am I hitting some kind a limit on the database side (oracle)? Has anyone seen this issue? Here is my script

       

      #!/bin/ksh

      URL_GetUser="https://xxx.xxx.com/api/core/v3/people?fields=-resources,id&count=100&startIndex=0"

      while true

      do

         curl -u admin:XXXXXXX $URL_GetUser > temp

         cat temp | grep \"id\" | awk -F: '{ print $2 }' | sed -e 's/^ //g' | sed -e 's/"//g' | sed -e 's/,//g' >> lou.txt

         NewUrl=`cat temp | grep "next" | awk -F: '{ print $3 }' | sed -e 's/^ //g' | sed -e 's/"//g'`

         if [ ! -z $NewUrl ]; then

            URL_GetUser="https:$NewUrl"

         else

            break

         fi

      done