Have the following script I used in the past to grab a little bit of information from the organization. Need to update it to grab the dynamic IP address that Meraki uses. I'm not sure what I'm looking for in the documentation. Can someone point me in the right direction? Thanks!
import requests
import json
#https://dashboard.meraki.com/api_docs
meraki_organizationID = 'MY ORG ID'
meraki_apikey = '-----'
meraki_apibaseurl = 'https://api.meraki.com/api/v0/organizations/'
#----------------------------------
meraki_apidevicestatusurl = meraki_apibaseurl + meraki_organizationID + '/deviceStatuses'
headers = {'X-Cisco-Meraki-API-Key': meraki_apikey}
url = meraki_apidevicestatusurl
response = requests.get(url,headers=headers)
# improve this to look at response code first
#Response code: 200
#print response.text
json_data = json.loads(response.text)
#print json_data
error = False
for i in json_data:
try:
print(i['name'] + ',' + i['status'] + ',' + i['publicIp'] + ',' + i['wan1Ip'] + ',' + i['networkId'] + ',' + i['serial'])
except:
#print 'error'
error = True
Guessing it needs to go at the end of the print line at the bottom. Just not sure what to add!