Rest API - Grab Public IP Address for WAN1, WAN2, and cellular for specific networks

Solved
NiftyMaker
Here to help

Rest API - Grab Public IP Address for WAN1, WAN2, and cellular for specific networks

I'm attempting to grab the public IP address off of a few interfaces for a specific networks in our organization but I'm struggling to get this completed.

 

I'm using the /appliance/uplink/statuses call and trying to filter by network using ?networkIds= but I'm clearly not doing something correct with my call.

 

$endpoint = "https://api.meraki.com/api/v1/organizations/$orgID/appliance/uplink/statuses?networkIds=**NetworkID**"

Invoke-RestMethod -Method GET -Uri $endpoint -Headers $header

 

This is just returning Invoke-RestMethod : The remote server returned an error: (400) Bad Request.

 

Would anyone be able to assist with this issue?

1 Accepted Solution
RaphaelL
Kind of a big deal
Kind of a big deal

Tested and the endpoint is working : 

 

RaphaelL_0-1648742577670.png

 

networkIds[]= XXXXXXXXXXXX  ( it is an array ) 

View solution in original post

5 Replies 5
KarstenI
Kind of a big deal
Kind of a big deal

networkIds is an array, do you send the data appropriate?

If you found this post helpful, please give it Kudos. If my answer solves your problem, please click Accept as Solution so others can benefit from it.
NiftyMaker
Here to help

As of right now I just have one network ID listed in there

 

Example:

$endpoint = 'https://api.meraki.com/api/v1/organizations/123456/appliance/uplink/statuses?networkIds=L_1234567890'

KarstenI
Kind of a big deal
Kind of a big deal

You still have to convert it, you are not allowed to send the single network ID as a string.

If you found this post helpful, please give it Kudos. If my answer solves your problem, please click Accept as Solution so others can benefit from it.
KarstenI
Kind of a big deal
Kind of a big deal

This is how I do it with the API:

uplinks = dashboard.appliance.getOrganizationApplianceUplinkStatuses(
          org_id, networkIds = net_id.split(), total_pages="all")

 

net_id is a single network which I first convert to the list that is sent to the API.

If you found this post helpful, please give it Kudos. If my answer solves your problem, please click Accept as Solution so others can benefit from it.
RaphaelL
Kind of a big deal
Kind of a big deal

Tested and the endpoint is working : 

 

RaphaelL_0-1648742577670.png

 

networkIds[]= XXXXXXXXXXXX  ( it is an array ) 

Get notified when there are additional replies to this discussion.