RUCKUS Community Forums are now in READ-ONLY mode while we migrate to a new platform.
You will still be able to read posts and knowledge articles, but will be unable to post new content until Go Live on the new platform Monday August 17.
Lennar Smart Home customers: please contact [email protected] for assistance during the week of August 9-17.
03-25-2022 09:35 AM
I wrote a Powershell script to generate DPSK for users, it works well on query Wlan, Zone, UserRole and other APIs..
But, when I want to generate a DPSK, it responded 400 error. I don't know what is the problem.
$UrlBase = "https://10.16.1.14:8443/wsg/api/public";
$apiVer = "v9_1"
$Zone_Id = "69e07745-bac7-4e24-9500-3902960e9700"
$Wlan_Id = "22"
$websession (believe me, $websession works well)
$body_gen=[pscustomobject]@{
amount = "1"
userName = "abc"
userRoleId = "e1538f2a-082c-4e19-b9d7-bc78de006967"
vlanId = ""
groupDpsk = "false"
}
$body_gen_JSON=$body_gen | ConvertTo-Json
Invoke-WebRequest -Uri $UrlBase/$apiVer/rkszones/$Zone_Id/wlans/$Wlan_Id/dpsk/batchGenUnbound -Method POST -Body $body_gen_JSON -ContentType 'application/json;charset=UTF-8' -WebSession $websession
Solved! Go to Solution.
03-26-2022 01:40 AM
I think I fixed it after checking API in Postman. The body should be the format as below:
$body_gen=[pscustomobject]@{
amount = 1
userName = "abc"
userRoleId = "e1538f2a-082c-4e19-b9d7-bc78de006967"
groupDpsk = $false
}
If you don't need to input VlanID, you should totally remove it in the body.
03-26-2022 01:40 AM
I think I fixed it after checking API in Postman. The body should be the format as below:
$body_gen=[pscustomobject]@{
amount = 1
userName = "abc"
userRoleId = "e1538f2a-082c-4e19-b9d7-bc78de006967"
groupDpsk = $false
}
If you don't need to input VlanID, you should totally remove it in the body.
