Hello Meraki & API fans,
I have discovered a problem that I wasn't able to solve today.
I am sure you all know the following code.
api_key = '093b24e85df15a3e66f1fc359f4c48493eaa1b73' #sandbox
import meraki
m = meraki.DashboardAPI(api_key)
orgs = m.organizations.getOrganizations()
print(orgs)
The result in my case is:
[{'id': '537758', 'name': 'Meraki Launchpad🚀', 'url': 'https://n149.meraki.com/o/d029Cc/manage/organization/overview', 'samlConsumerUrl': 'https://n149.meraki.com/saml/login/d029Cc/rtFn7bJtIRna', 'samlConsumerUrls': ['https://n149.meraki.com/saml/login/d029Cc/rtFn7bJtIRna']}, {'id': '549236', 'name': 'DevNet Sandbox', 'url': 'https://n149.meraki.com/o/-t35Mb/manage/organization/overview'}]
My goal is to have python code that delivered the organization ID to a corresponding organization name.
Like, give me the ID from the Organisation with the name Meraki Launchpad🚀.
The ID is 537758
I have searched the whole day was not able how to transform the data to get this information.
I need this because I want to create a new organization with the API and then the same script should return the Id of the newly created organization so that I can use that information for the next operations or following scripts.
But I don't want to request all Orgs and then copy past the key by hand this should come from the script.
If You do think I am on the wrong way with the problem above feel free to let me know.
Thanks for your replies.