Thanks for the help guys, I did see the API but wasn't very familiar with how to use it. Sorry for the delay in getting back I got pulled in other directions.
I was able to set up everything PaulF posted and then eventually I was able to figure out how to get the orgid however I am stuck as I am getting the message
"No devices in this SM network"
but we have
* 414 devices (mostly iOS iPhones and also a few iPads, iPods and a few Android phones)
* across 82 networks
* No other devices besides iOS/Android
So I must be doing something wrong but don't know what.
Here is the output from the code I used to get the orgID
2023-04-11 15:10:36 meraki: INFO > Meraki dashboard API session initialized with these parameters: {
'version': '1.32.1',
'api_key': '**last 4 of my api key was in here**',
'base_url': 'https://api.meraki.com/api/v1',
'single_request_timeout': 60',
'certificate_path': '',
'requests_proxy': '',
'wait_on_rate_limit': True,
'nginx_429_retry_wait_time': 60,
'action_batch_retry_wait_time': 60,
'retry_4xx_error': False',
'retry_4xx_error_wait_time': 60',
'maximum_retries': 2',
'simulate': False',
'be_geo_id': None',
'caller': None',
'use_iterator_for_get_pages': False}
2023-04-11 15:10:36 meraki: INFO > GET https://api.meraki.com/api/v1/organizations
2023-04-11 15:10:37 meraki: INFO > organizations, getOrganizations - 200 OK
[{
'id': 'a 6 digit number was in here',
'name': 'Our company name was in here',
'url': 'https://n22.meraki.com/o/{{6 digits numbers/letters not sure if it safe to post}}/manage/organization/overview',
'api': {'enabled': True}',
'licensing': {'model': 'co-term'}',
'cloud': {'region': {'name': 'North America'}}',
'management': {'details': []}
}]
Here is the code I used to get the orgID
API_KEY = '**Used my api key**'
dashboard = meraki.DashboardAPI(API_KEY)
response = dashboard.organizations.getOrganizations()
Which I got from here: Getting-started-with-Meraki-API-using-Python-Part-2-Python-Setup
Here is the output from the yourscriptname.py from the above post:
2023-04-11 15:11:56 meraki: INFO > Meraki dashboard API session initialized with these parameters: {'version': '1.32.1',
'api_key': '**last 4 of my api key was in here**',
'base_url': 'https://api.meraki.com/api/v1',
'single_request_timeout': 60',
'certificate_path': '',
'requests_proxy': '',
'wait_on_rate_limit': True',
'nginx_429_retry_wait_time': 60',
'action_batch_retry_wait_time': 60',
'retry_4xx_error': False',
'retry_4xx_error_wait_time': 60',
'maximum_retries': 2',
'simulate': False',
'be_geo_id': None',
'caller': None',
'use_iterator_for_get_pages': False}
2023-04-11 15:11:56 meraki: INFO > GET https://api.meraki.com/api/v1/organizations/{{The 6 digit 'id' number from the first script was here}}/networks
2023-04-11 15:11:56 meraki: INFO > organizations, getOrganizationNetworks; page 1 - 200 OK
networkID, model, osName, systemModel
2023-04-11 15:11:56 meraki: INFO > GET https://api.meraki.com/api/v1/networks/L_{{18 numbers}}/sm/devices
2023-04-11 15:11:57 meraki: INFO > sm, getNetworkSmDevices; page 1 - 200 OK
No devices in this SM network
2023-04-11 15:11:57 meraki: INFO > GET https://api.meraki.com/api/v1/networks/L_{{18 numbers}}/sm/devices
2023-04-11 15:11:59 meraki: INFO > sm, getNetworkSmDevices; page 1 - 200 OK
Traceback (most recent call last):
File "D:\Dev\Misc\Meraki API\iOS\iOS.py", line 71, in <module>
main(sys.argv[1:])
File "D:\Dev\Misc\Meraki API\iOS\iOS.py", line 55, in main
print(networkID, ",", device["name"], ",", device["osName"], ",", device["phoneNumber"])
KeyError: 'phoneNumber'
Any ideas as to what I can do to fix whatever I am doing wrong?