python-intercom icon indicating copy to clipboard operation
python-intercom copied to clipboard

intercom.errors.ResourceNotFound: scroll parameter not found

Open oscar-lukersmith opened this issue 7 years ago • 0 comments


a = 0
insert = ''

for user in intercom.users.scroll():
  amp_id = non_type(user.id)
  user_id = non_type(user.user_id)

  if len(insert) == 0:
    insert = "('" + amp_id + "','" + user_id + "')"
  else:
    insert = insert + ",('" + amp_id + "','" + user_id + "')"
  a += 1 

  if a % 10000 == 0:
    lets_insert = insert_query.format(insert)
    cursor.execute(lets_insert)
    con.commit()
    insert = ''
   

It seems to reach different lengths in the scroll (130k records and then 240k records) and then errors out saying intercom.errors.ResourceNotFound: scroll parameter not found. I understand i probably need to pass the scroll parameter from the previous scroll but I cant figure out how to do it. Any help would be greatly appreciated - also apologies if I have missed anything in the docs I can't find anything about scroll.

oscar-lukersmith avatar Oct 09 '18 06:10 oscar-lukersmith