Trying to update SSID PSK receiving 404

Solved
StephenMeyer
Just browsing

Trying to update SSID PSK receiving 404

I can successfully call and get the data from getting a specific SSID network details, when i try to update the password {psk} i get a 404. Below is a snippet of the powershell code i am trying,

 

$deviceAPIUri = "$baseUrl$dashboardAPIVersion/networks/$MYNETWORK_ID/wireless/ssids/$GUEST_ID"
$response = Invoke-WebRequest -Uri $deviceAPIUri -Method GET -Headers $headers
 
 
#
# Check if Guest

if ($response.StatusCode -eq 200 ){

 
$ssidConfig = $response | ConvertFrom-Json

$ssidConfig.psk = "HelloThere"

#
#create JSON body with data to update.
#
 
$body = (ConvertTo-Json $ssidConfig)

Write-Host $body

$response1 = Invoke-RestMethod -Uri $deviceAPIUri -Method POST -Headers $headers -Body $body

write-host $response1
 
 
Please help. I have been able to use powershell and interact with the dashboard API without fail... until now.
1 Accepted Solution

Found your issue... You have to use PUT and not POST

 

Greenberet_0-1647267265606.png

 

View solution in original post

7 Replies 7
Greenberet
Head in the Cloud

You are probably adding empty data from the "full" get result.

 

If you just want to change the SSID, then just change the SSID

 

json body:

 

{'psk': 'HelloThere'}

 

StephenMeyer
Just browsing

I changed code to just send psk with same results. I get a 404 not found.  The new json body: {"psk": "hello"}

I'm not sure about the response here and can't test it at the moment, but "hello" is to short for a psk. "HelloThere" did work fine for me

StephenMeyer
Just browsing

I updated to HelloThere and still receiving the 404.  What is strange is the GET works without fail. It is only the post. 

Found your issue... You have to use PUT and not POST

 

Greenberet_0-1647267265606.png

 

StephenMeyer
Just browsing

Thank you so much... missed that.

No problem 😃

sometimes the issues are in the smallest mistakes ^^

Get notified when there are additional replies to this discussion.
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.