- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
getDevice and updateDevice doesn't work
I'm making a simple web-application for a client using the Meraki API. But neither of the two requests that is needed for the application is working and I cannot seem to get what is wrong. It's regarding the get-request getDevice and put-request updateDevice. All I receive is 404.
This is for the get-request:
curl -L --request GET \
--url https://api.meraki.com/api/v1/devices/XXXXXXXXXXXX \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-Cisco-Meraki-API-Key: [my api key]'
and this is for the put-request:
curl -L --request PUT \
--url https://api.meraki.com/api/v1/devices/XXXXXXXXXXXX \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-Cisco-Meraki-API-Key: [my api key]'
(i'm usually doing all of this in postman in then I have a body of course for the put-request)
i've also tried tried adding networks/network_id along with /sm in the path, but nothing is working and the documentation doesn't provide any answer whatsoever. And yes my key is valid, i can still get all the devices from a certain network and such. And I've made sure that the device is not in the inventory but in an actual network. Any ideas or has anyone had the same problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
First, ensure you have the right network permission(which I assume you already have as you can get the organization list). Then try the below curl command to rule out any library issues.
curl -L --request GET \
--url https://api.meraki.com/api/v1/devices/[YOUR SERIAL NUMBER] \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-Cisco-Meraki-API-Key: [YOUR API KEY]'
Please, if this post was useful, leave your kudos and mark it as solved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I may be wrong, but what you wrote is identical to mine. Is it working for you that request?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, the commands you are running are correct. Just check if you have the correct network permission, if the S/N and API key are correct.
If everything is ok, I suggest you open a support case.
Please, if this post was useful, leave your kudos and mark it as solved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yeah I opened a case, thanks for the help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try updating your curl command to use the Bearer authorization instead.
curl -L --request GET \
--url https://api.meraki.com/api/v1/devices/{serial} \
--header 'Authorization: Bearer 75dd5334bef4d2bc96f26138c163c0a3fa0b5ca6' \
--header 'Accept: application/json'
https://developer.cisco.com/meraki/api-v1/get-device/
Like what you see? - Give a Kudo ## Did it answer your question? - Mark it as a Solution 🙂
All code examples are provided as is. Responsibility for Code execution lies solely your own.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On the page @rhbirkelund gave (or any other API page), select "Code Snippets", "Curl" to get a copy and paste example.
