- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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"
]
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
