Hi,
I am trying to deactivate a user using REST API. I am usting the following API
https://inphitraining.autodeskplm360.net/api/rest/v1/users/xxxx?Content-Type=application/json&Accept=application/json
{
"userStatus":{"value":"Y"}
}
I get "HTTP Status 415 - Unsupported Media Type"
Has anyone attempted doing this? If yes please provide the JSON payload.
Regards,
Ravi
Solved! Go to Solution.
Solved by rdalli. Go to Solution.
Solved by gasevsm. Go to Solution.
Hi Ravi,
To update (PUT) a user, use similar payload as when used to create (POST) a user.
The major difference is you need to provide the userID at the end of the endpoint.
POST /api/rest/v1/users : Create a new user
PUT /api/rest/v1/users/<userID> : Update user matching userID
Hope this helps,
Thank you Martin,
I was able to use the APIs and deactivate a user.
For othher who want to update users using REST, below is what I used.
PUT https://inphitraining.autodeskplm360.net/api/rest/v1/users/usedid
Header=> Content-Type = application/json
Payload:
{
"loginName":"JohnDoe",
"password":"Password1",
"firstName":"John",
"lastName":"Doe",
"licenseType":{"value":"S"},
"userStatus":{"value":"N"},
"email":"jdoe@abc.com",
"userTimeZone":{"value":"America/Los_Angeles"},
"showThumbnailPreference":"N",
"uomPreference":{"value":"metric"}
}