Response Data from API's | Community
Skip to main content

Response Data from API's

  • July 27, 2022
  • 5 replies
  • 0 views

Hi,

I am using an integration tool to return all of the Users for my organisation and put them into a db table. There are more than 100,000 users so when I call the API it returns a 429 error (Too many requests) which is the limit for the API.

I then need to return the next batch of users, using the incremental export “GET /api/v2/incremental/users?start_time={start_time}”, but I don’t know what value I need to provide  in the {start_time} parameter.

The User API returns created_at and updated_at in the entity users response. Which one do I need to use.

Any help would be much appreciated.

5 replies

  • Author
  • July 27, 2022

Just to add to my initial post, I will be retrieving the maximum date from the db table to use as the {start_time} but I just need to know if it created_at or updated_at.

Thanks again 


Greg29
  • July 27, 2022
Hi Peter! Please read our documentation on this topic which you can find here

  • Author
  • July 28, 2022

Hi Greg,

 
thankyou for your response.
 
I've read the documentation that you kindly directed me to.
It says to use the generated_timestamp to use for start_time.
 
I can see generated_timestamp in the tickets request but I can't see it in the response when I call the users api, api/v2/incremental/users.json.
 
Thanks
Pete

Greg29
  • August 2, 2022

Hi Peter! The generated_timestamp isn't necessary to use for start_time...instead you would use the next_page url or end_time at the bottom of the list of users. If this is your first export, you can just start with an arbitrary time that is set before your account was created. Subsequent calls will use the next_page url/end_time, which will contain the users created after the last record on the first export, assuming that there are additional users. You can determine that by seeing if end_of_stream is set to false. If it is, you have additional users on the next page. If it is not, the next_page url/end_time will be set to the update_at time of the last user  in your response.

I hope that clarifies this for you, but let us know if you have any more questions about this.


Greg29
  • August 2, 2022
Hi Peter!