Forum Discussion

Denis_T's avatar
2 years ago

API request doesn't return all objects..

I am trying the API request with the following (skipping authentication header below and other non relevant parts): .... company = d['company'] access_id = d['access-id'] access_key = d['access...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Output the URL and your headers to your screen and verify the same behavior in postman. If it does the same thing in postman, it's a problem with the API. If postman fetches it just fine, it's your script. 

    If you're using python, consider using the SDK. Much easier:

    alerts = lm.get_alert_list(size=1000,offset=0).items

     

    If you need pagination (because there are more than 1000 items):

    alerts = []
    end_found = False
    offset = 0
    size = 1000
    while not end_found:
      current = lm.get_alert_list(size=size, offset=offset).items
      alerts += current
      offset += len(current)
      end_found = len(current) != size