powershell REST API issue with Meraki Dashboard API

DennisSSebasiSt
Comes here often

powershell REST API issue with Meraki Dashboard API

I'm having a problem with a specific REST api from meraki. I have been able to perform all the get operations with success, however the POST operations I am receiving a "308" error from the server. I'm trying to do the following:

 

Example request:

 

curl -L -H 'X-Cisco-Meraki-API-Key: <key>' -X POST -H 'Content-Type: 
application/json' --data-binary '{"name":"Miles Meraki", 
"email":"miles@meraki.com", "orgAccess":"none", "tags":[{"tag":"west", 
"access":"read-only"}]}' 
'https://dashboard.meraki.com/api/v0/organizations/1234/admins'
My Request:
Invoke-RestMethod -Method Post -Uri https://dashboard.meraki.com/api/v0/organizations/$global:MerakiOrg/admins/ - Body $jbody -Headers $Global:MerakiHeader -ContentType 'application/json' 

 My $jbody value is the literal copied json from the example. I'm not familiar with this 308 code as a return code. Any guidance would be very helpful.

3 Replies 3
Edgar-VO
Building a reputation

Hi there,

 

I have found this one for you.... Maybe some help

 

https://stackoverflow.com/questions/44350045/powershell-rest-api-issue-with-meraki-dashboard-api

 

Seems a URL redirect error

 

Hope it helps

 

sungod
Kind of a big deal

Bear in mind that you are using v0 API endpoints, v0 has been deprecated for some time and is now in sunset period where operation is not guaranteed, see:

https://community.meraki.com/t5/Developers-APIs/Dashboard-API-v0-End-of-Support-Sunset-amp-Grace-Per...

 

You really should use v1, it is the current version and is where new features are added.

John_on_API
Meraki Employee
Meraki Employee

Thanks for reaching out! Glad you asked this publicly because there's a good chance you're not the only person to google this issue.

 

The shortest solution is to use API v1 endpoints, which have the base URL api.meraki.com, thus avoiding the v0 deprecation issue (as @sungod mentioned), and reaping the benefits of both api.meraki.com and API v1 endpoints.

 

Of course, if you can reproduce this issue using api.meraki.com and the v1 endpoint, let us know!

Get notified when there are additional replies to this discussion.