1 Reply Latest reply on Feb 23, 2016 12:09 PM by Ryan Rutan

    Why does getting user details from the batch requests yields errors?

    bharatpec

      Hi All,


      I have a question regarding batch requests. I'm getting user details (their profile) from my space by creating batch of requests.

       

      {

              'key': 'people',

              'request': {

                  'endpoint': 'https://' + community.host + '/api/core/v3/people/?sort=firstNameAsc&fields=jive,name&origin=unknown&count=25&startIndex=' + a,

                  'method': 'GET'

      }

       

      I'm getting 25 people at a time.

      As, I can make a batch of 25 batch calls (jive API restriction), I can get a total of 25*25 = 625 users at a time. I'm making multiple batch calls for getting batches of first 625 users, then next 625, then next 625 and so on....
      Some batch calls are successful, but some batch calls are failing.
      For the cases where the batch call is failing, I have an observation that the JSON returned is incomplete and my JSON.parse(response) fails.

       

      ok.png

       

      This is happening because returned body is an incomplete json. if I make seperate calls (not batch call) for the users one by one, It works fine.
      My question is why am I getting some batch calls with errors and some calls with no errors? Is it something from the Jive's end?


      Thanks in advance!
      Bharat Sethi