07/13/2022 06:59 AM
I'm trying to update a user using updateUserRequest, below is the request:
{
"username": "r6HNHFSR0022@test.com",
"street": "street_test",
"dynamicattrsvalidation": "false"
}
But I am getting this response:
{
"msg": "Either nothing to update or cannot update the params passed",
"errorcode": "1"
}
What causes this error? There's no information in the API Documentation.
Solved! Go to Solution.
07/13/2022 10:13 AM
When using updateUserRequest API, you can only modify the attributes that are present in your user form (dynamic attributes).
For e.g. I have a dynamic attribute "street", which could be mapped to a user column or not but as long as it exists in the user form, it allows me to update it.
Now "displayname" is a valid user attribute but it is not configured as a dynamic attribute in the user form, hence I cannot update this using the updateUserRequest.
Note: However I can update valid user attributes using updateUser API
Please validate if you have the dynamic attributes in the user form and also note that these are case sensitive.
07/13/2022 12:22 PM
Thank you very much @avinashchhetri
Your comment pointed me in the right direction and I have a working request now, but I have some observation and corrections:
1. The attributes are case sensitive but not in conventional sense, for example, I have this dynamic attribute:
and it is mapped to street attribute of user profile:
BUT, this request fails if I use the correct case:
However, if I put "manaddstreet" in all lower case it works: 😂
(Saviynt is full of such quirks and "features" and it is really frustrating sometimes, as none of this behavior is documented)
See, the user attribute is updated as expected:
2. the dynamic attribute must be mapped to a user profile attribute, other wise the request response is success but nothing is written/updated on user profile.
If I remove the user column mapping, marked below, then request is submitted and you get a successful response from API (as Avinash got above), BUT the user attribute is not updated.
(For future readers: as you can see in above screenshot, Editable on update must be checked for the API call to work for that attribute, I have kept the attribute hidden on both create and update and I can confirm that I can update the attributes this way and the form isn't affected as the attribute is not shown on the create/update forms)
In user history a blank update is recorded if the User Column is kept blank, and no attribute is updated, and this makes sense:
OP's commentary:
This API feels very very very wonky, at least in the version v5.5 sp3 which unfortunately our customer is on.
There is a cool bypass in future versions apparently which removes all this dynamic attribute non-sense, it's called "dynamicattrsvalidation" and it works like below in all future versions:
BUT oh no! you won't hear about it in the official documentation of the API, even the latest version's API has no mention of above config:
07/13/2022 12:50 PM
Good to know your issue is resolved. I will provide a feedback to the documentation team.
I will suggest that you import the collection in your Postman and then use it. That ways you will have samples from all the API's and will save you time and effort.
However, having said that we do need to improve our documentation and that is one of the high priority items that is tracked at our end.