Filtering /networks/{networkId}/sm/devices by ownerEmail

Solved
RunAMuck
New here

Filtering /networks/{networkId}/sm/devices by ownerEmail

Hello all - 

 

I am trying to use the Meraki Systems Manager API to return all devices associated with a specific user's email address. Can someone tell me how to format the API curl request to achieve this? 

 

 /networks/{networkId}/sm/devices

1 Accepted Solution
JasonM
Meraki Employee
Meraki Employee

The data field ownerEmail is an option to provide in the fields parameter that is of type array. It only allows to display additional fields in the returned response body and is not a query parameter to filter on a specific value. You will have to return all the results first, including the ownerEmail field, and then filter the response accordingly.

View solution in original post

4 Replies 4
RaphaelL
Kind of a big deal
Kind of a big deal

I don't have anything SM related to test , but according to the API doc it might be :

 

https://developer.cisco.com/meraki/api-latest/#!get-network-sm-devices

 

/networks/{networkId}/sm/devices?ownerEmail="john.doe@hotmail.com"  

RunAMuck
New here

Thanks for the reply! Unfortunately, I get this error when I try this call:


https://api.meraki.com/api/v1/networks/{networkid}/sm/devices?ownerEmail="john.doe@hotmail.com"

 

{
"errors": [
"Invalid parameters(s): ownerEmail"
]
}

RaphaelL
Kind of a big deal
Kind of a big deal

I misread the documentation. 

 

I think you have to do /networks/{networkId}/sm/devices?fields[]=ownerEmail or /networks/{networkId}/sm/devices?fields=ownerEmail  

 

Then you could filter the json received with the selected Email. If that makes sense

JasonM
Meraki Employee
Meraki Employee

The data field ownerEmail is an option to provide in the fields parameter that is of type array. It only allows to display additional fields in the returned response body and is not a query parameter to filter on a specific value. You will have to return all the results first, including the ownerEmail field, and then filter the response accordingly.

Get notified when there are additional replies to this discussion.