Refer to the exhibit. Drag the code snippets from the bottom to the blanks in the Python script to retrieve a host list by using the Cisco DNA Center API. Not every option is used. <DragDrop items={["application/json","data['response']","\"Token\"","json()","token","[0]"]} slots={[{"answer":"application/json","id":"content_type"},{"answer":"json()","id":"token_json"},{"answer":"data['response']","id":"devices"},{"answer":"token","id":"token_arg"}]} template={"import json, requests, urllib3\nfrom requests.auth import HTTPBasicAuth\nfrom config import host, username, password\n\nheaders = { 'content-type': \"{{content_type}}\", 'x-auth-token': \"csd0934rjxx\" }\n\ndef dna_api_auth(host, username, password):\n url = \"https://{}/dna/intent/api/v1/network-device/auth/token\".format(host)\n response = requests.post(url, auth=HTTPBasicAuth(username, password),\n headers=headers, verify=False)\n return response.{{token_json}}[\"Token\"]\n\ndef list_dna_devices(token):\n url = \"https://{}/api/v1/network-device\".format(host)\n headers[\"x-auth-token\"] = token\n response = requests.get(url, headers=headers, verify=False)\n data = response.json()\n for item in {{devices}}:\n print(item[\"hostname\"])\n\ntoken = dna_api_auth(host, username, password)\nlist_dna_devices({{token_arg}})"} explanation={"Cisco DNA Center token authentication uses an application/json content type and returns JSON containing a Token value. The device-list response is JSON whose response member contains the returned network-device records; each record can therefore be used to print its hostname. The retrieved token must be supplied to the device-list function so it can be set as the X-Auth-Token header.\n\n**Learn more:** [Cisco Catalyst/DNA Center API: Devices](https://developer.cisco.com/docs/dna-center/devices/) · [Cisco Catalyst Center API: Get Device list](https://developer.cisco.com/docs/dna-center/get-device-list/)"} reuse={false} />