kbhax
kbhax

Reputation: 33

Error when attempting to disable account - BOX Api v2

I am attempting to disable a user account using the BOX 2.0 API. However, I am receiving a 400 status code error. In an effort to troubleshoot, I attempted to update a user attribute but once again received the 400 status code error. I even received the error when using the example in the documentation for updating user information (with my own parameters of course).

I am utilizing Powershell 3.0. I thought maybe I had something wrong in the syntax but received the exact same error using Postman in Chrome. Any guidance would be appreciated!

My Code:

Invoke-RestMethod -Uri https://api.box.com/2.0/users/USER_ID \
    -method PUT \
    -Headers @{"Authorization"="Bearer ACCESS_TOKEN"} \
    -Body @{"status"="inactive"}

Error:

{"type":"error","status":400,"code":"bad_request","help_url":"http://developers.box.com/docs/#errors","message":"Bad Request","request_id":"1028858396513419e934e95"}

Upvotes: 1

Views: 472

Answers (1)

paapfly
paapfly

Reputation: 241

are you an administrator in this account? If you are an administrator, are you attempting to set another admin user to inactive? You will need to not only be an admin, but have privileges above the user that you're attempting to set to inactive.

Upvotes: 1

Related Questions