QuestionQ577
Understanding and Using APIsRefer to the exhibit. An engineer sends a request to collect data through the Cisco AMP for Endpoints API. The engineer must list guide and hostname data for all computers, but the first request returns only 500 items out of 2,000. The engineer then adds a loop to retrieve all the data. What must be inserted at the missing location to complete the requests?
Drag & Drop
next_url = response_json ['metadata'] ['links'] ['next']
url = 'https://api.amp.cisco.com/v1/computers' response = session.get (url) response_json = response.json () for item in response_json ['data']: print(item['connector_guid'], item['hostname']) while 'next' in response_json['metadata'] ['links']: response = session.get (next_url) response_json = response.json() for item in response_json['data']: print(item['connector_guid'], item['hostname'])
Community Discussion