If you are ever wondering where in the hell do I need to put the Query Parameters inside Meraki python library?
Here is your answer
In this example, we want to bring a list of the wireless connectivity events for a specific client within a network in the timespan.
Meraki API URL:
https://developer.cisco.com/meraki/api-latest/#!get-network-wireless-client-connectivity-events
The API documentation looks like this:
What we need:
![NesAlba_0-1656604028741.png NesAlba_0-1656604028741.png](https://community.meraki.com/t5/image/serverpage/image-id/24338i1406BF9DEA23E7DA/image-size/medium?v=v2&px=400)
Query: What I can filter by.(we have a lot of options here):
![NesAlba_1-1656604028743.png NesAlba_1-1656604028743.png](https://community.meraki.com/t5/image/serverpage/image-id/24337iA58C0187E59419C7/image-size/medium?v=v2&px=400)
i.e If we want to bring only an specific type of severities , you find the “includedSeverities” in que Query list
![NesAlba_2-1656604028745.png NesAlba_2-1656604028745.png](https://community.meraki.com/t5/image/serverpage/image-id/24339iAD5013EAD2D0F256/image-dimensions/518x104?v=v2)
But if you look at a “Meraki Python Library“ template there are no instructions or examples of where in the hell put that Query parameter
![NesAlba_3-1656604028750.png NesAlba_3-1656604028750.png](https://community.meraki.com/t5/image/serverpage/image-id/24340iB5CB0D29430E6798/image-dimensions/173x129?v=v2)
![NesAlba_4-1656604028755.png NesAlba_4-1656604028755.png](https://community.meraki.com/t5/image/serverpage/image-id/24341i8FF8AC5BDFA2AEB5/image-size/medium?v=v2&px=400)
So here is where you need to put the Query parameter:
![NesAlba_5-1656604028763.png NesAlba_5-1656604028763.png](https://community.meraki.com/t5/image/serverpage/image-id/24342i2D2E8BD1DA3BDAF6/image-dimensions/743x231?v=v2)
Create a variable “severities” with the includedSeverities valid values and then add “includedSeverities” query parameter in the response… and voilà.
So in looks like this:
##includedSeverities = query param
##severities = variable with valid value
#in this case the valid values are: 'good', 'info', 'warn' and/or 'bad'.
import meraki
API_KEY = 'xxxxx'
dashboard = meraki.DashboardAPI(API_KEY)
network_id = 'xxxx'
client_id = 'xxxx'
severities= "bad"
response = dashboard.wireless.getNetworkWirelessClientConnectivityEvents(
network_id, client_id, total_pages= all, includedSeverities =severities
)
print(response)
Use case example:
If you want a python script to input the severity instead of editing the script.
It should look like this:
import meraki
print()
print("Severities")
print("1 -- good")
print("2 -- info")
print("3 -- bad ")
sev = input("Enter the severity exact name:")
API_KEY = '<You API key>'
dashboard = meraki.DashboardAPI(API_KEY)
network_id = '<target Network id>'
client_id = '<target Client id>'
severities= sev
response = dashboard.wireless.getNetworkWirelessClientConnectivityEvents(
network_id, client_id, total_pages=, includedSeverities =severities)
print(response)
.
.
.
And is the same with all Query Parameters
![NesAlba_6-1656604391046.png NesAlba_6-1656604391046.png](https://community.meraki.com/t5/image/serverpage/image-id/24343i9BE52C00F31E74DC/image-size/medium?v=v2&px=400)