Post

3 followers Follow
0
Avatar

REST API - User State read-only

Using REST API, how do I disable a user?  I see:

https://api.clarizen.com/V2.0/services/data/ChangeState

But this does not seem to apply to the User entity.

I've also asked in this older post (so please forgive me).  State is read-only for users and cannot be altered in the UI to remove the read-only.  So there must be another way I've not seen. 

https://success.clarizen.com/hc/en-us/community/posts/203993138-User-Provisioning

Kurt Kremer Answered

Please sign in to leave a comment.

7 comments

0
Avatar

Repeated from other post.  This was the first attempt before seeing the ChangeState above (which does not seem to apply to User)

curl -X POST -H "Authorization: Session xxx" -d "{'State':'Disabled'}" https://api.clarizentb.com/v2.0/services/data/objects/User/xxx
{"errorCode":"InvalidOperation","message":"Invalid operation: Field 'State' cannot be updated. The field is marked 'read-only'.","referenceId":"xxx"}

What would be the REST way of updating state?  I can update other fields.  Just not this one.  And I cannot change its setting in the admin UI.

Kurt Kremer 0 votes
Comment actions Permalink
0
Avatar

Confirmed:

{

"errorCode": "General",
"message": "Change State message supported only for Work Item | Expense Sheet | Customer | Timesheet | Staffing Request",
"referenceId": "PGktI2Q0bYOeWmLUIgFUc"

}

Kurt Kremer 0 votes
Comment actions Permalink
0
Avatar

Elad Franklin you are the bomb! Shame on me for not translating that web services comment...

Kurt Kremer 0 votes
Comment actions Permalink
0
Avatar

Hi Elad,

 

I have tried using the above URL but still it is not working, instead i am getting below error, could you please advice?

 

Regards,
Sai Teja

Sai Chelluboina 0 votes
Comment actions Permalink
0
Avatar

Hi Sai,

Please make sure you are sending the authorization header with a valid session id.

Elad Franklin 0 votes
Comment actions Permalink