- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Error on api v1 for /networks/:networkId/sm/devices?fields={{fields}}
Hi ,
I was trying to add additional fields to return for SM Devices.
But I am finding this error
Solved! Go to solution.
- Labels:
-
Dashboard API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
/networks/:networkId/sm/devices?fields[]={{fields}}
I was trying some error and trial and the above worked for me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you got it formatted as an array?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've noticed this as well, particularly as a v0 to v1 problem.
The documentation for v0 actually states to use a comma-separated string for fields, which works for v0.
https://developer.cisco.com/meraki/api/#!get-network-sm-devices
This fails in v1. Trying to use an array doesn't work either.
This works (v0):
https://api.meraki.com/api/v0/networks/{{networkId}}/sm/devices?fields=id,name,lastUser,ownerEmail,ownerUsername
These do not (v1):
https://api.meraki.com/api/v1/networks/{{networkId}}/sm/devices?fields=id,name,lastUser,ownerEmail,ownerUsername
https://api.meraki.com/api/v1/networks/{{networkId}}/sm/devices?fields=[id,name,lastUser,ownerEmail,ownerUsername]
https://api.meraki.com/api/v1/networks/{{networkId}}/sm/devices?fields=['id','name','lastUser','ownerEmail','ownerUsername']
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
/networks/:networkId/sm/devices?fields[]={{fields}}
I was trying some error and trial and the above worked for me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following API call on version 1 should allow this to work for anyone who is curious:
{{baseUrl}}/networks/:networkId/sm/devices?fields[]=id,name
