Querying API endpoint by networkID and OrganizationID

SOLVED
DevK
Here to help

Querying API endpoint by networkID and OrganizationID

Hello Team,

 

I'm working on API to fetch events from the endpoint:

{baseURI}//networks/{networkId}/events

 

I have multiple organization and it has multiple networks. So, my query is instead of networkID, is there any endpoint where we can query to full organization and fetch events for all networks in that organization instead of querying each network? Is it possible?

 

For eg:

For appliance(MX) security events, we can use organization ID instead od networkID to get security events.

/networks/{networkId}/appliance/security/events

/organizations/{organizationId}/appliance/security/events

 

Similarly, can we use org ID for {baseURI}//networks/{networkId}/events?

 

Thank you.

1 ACCEPTED SOLUTION
AutomationDude
Building a reputation

Hey @DevK , Network level endpoints only work for networks and org level endpoints only work for orgs. Unfortunately there isn't a direct way to get what you're looking for but fortunately, there is a relatively simple way. It's called loops.

 

Im not sure if loops are possible in Postman but you should definitely look into using Python if aren't already.

 

Here's the concept I'm talking about: 

https://www.youtube.com/watch?v=94UHCEmprCY

 

Here's a free course I made specifically for Meraki APIs that includes examples of this:

https://go.boundlessdigital.com/meraki-api-with-python-course/registration

 

View solution in original post

2 REPLIES 2
AutomationDude
Building a reputation

Hey @DevK , Network level endpoints only work for networks and org level endpoints only work for orgs. Unfortunately there isn't a direct way to get what you're looking for but fortunately, there is a relatively simple way. It's called loops.

 

Im not sure if loops are possible in Postman but you should definitely look into using Python if aren't already.

 

Here's the concept I'm talking about: 

https://www.youtube.com/watch?v=94UHCEmprCY

 

Here's a free course I made specifically for Meraki APIs that includes examples of this:

https://go.boundlessdigital.com/meraki-api-with-python-course/registration

 

Thank you. Looking into it.

Get notified when there are additional replies to this discussion.
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.
Labels