ryan77
August 12, 2023, 1:24pm
1
Trying to use the method here remove a users seat
https://developers.cloudflare.com/api/operations/zero-trust-seats-update-a-user-seat
Keep getting:
{
“result”: null,
“success”: false,
“errors”: [
{
“code”: 12074,
“message”: “access.api.error.invalid_user_seat”
}
],
“messages”:
}
The seat_uid is the same one retrieved from the /access/users request.
Thoughts?
Need a bit more detail about what language and code looks like.
I had this problem in Python, as I wasn’t sending the JSON as an array , i.e. the outer square brackets in the data you send are important.
Not sure if your problem was the same
Hey,
I have the same problem.
I’m using Powershell and the same result on Postman.
I tried with body as a String, Array, Hashtable, Converted to Json.
Nothing helped.
$data = @{
“access_seat” = $false
“gateway_seat” = $false
“seat_uid” = “HERE IS SEAT UID”
}
$data = ‘{
“seat_uid”: “HERE IS SEAT UID”,
“access_seat”: false,
“gateway_seat”: false
}’
$data = ‘{
“seat_uid”: HERE IS SEAT UID,
“access_seat”: false,
“gateway_seat”: false
}’
[array]$data = @{
“access_seat” = $false
“gateway_seat” = $false
“seat_uid” = “HERE IS SEAT UID”
}
ryan77
August 31, 2023, 2:02pm
5
My issue was actually resolved by making sure it was in an array.
Could you send final version of your json format?
ryan77
August 31, 2023, 2:50pm
7
Sure:
[{
“access_seat”: false,
“gateway_seat”: false,
“seat_uid”:“”
}]
JakubRG
September 1, 2023, 6:35am
8
For some reason Powershell while converting to JSON version skips outer square brackets.
So after converting I had to add brackets manually.
$data = @{
access_seat = $false
gateway_seat = $false
seat_uid = “seat_uid”
}
$jsonData = “[”, ($data | ConvertTo-Json), “]”