Announcing the SAVIYNT KNOWLEDGE EXCHANGE unifying the Saviynt forums, documentation, training, and more in a single search tool across platforms. Click HERE to read the Announcement.

Errors in updateUserRequest API call

yogesh
Regular Contributor III
Regular Contributor III

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"
}

yogesh_0-1657720355700.png

What causes this error? There's no information in the API Documentation.

"dynamicattrsvalidation" has no effect in my request as we're still on v5.5 sp3.
I have tried with other attributes like firstname and customproperty4 as well, I am able to update "firstname" but not "street" or "customproperty4"? What is the criteria that is causing this error?
 
On the user update form we have dynamic attributes mapped to "street" and "firstname" both but no attribute linked to "customproperty4".
Both dynamic attributes, "street" and "firstname", are strings as well yet I can update one but not the other.
 
I tried to workaround this by using profile attributes that are not mapped to any dynamic attributes i.e. "customproperty4". It is not mapped to any user dynamic attribute yet that too fails with same error as "street" shown above.
3 REPLIES 3

avinashchhetri
Saviynt Employee
Saviynt Employee

@yogesh

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.

avinashchhetri_0-1657731612358.png

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.

avinashchhetri_1-1657731726475.png

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.

 

 

Regards,
Avinash Chhetri

yogesh
Regular Contributor III
Regular Contributor III

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:
yogesh_0-1657738290811.png
and it is mapped to street attribute of user profile:

yogesh_1-1657738310364.png
BUT, this request fails if I use the correct case:
yogesh_2-1657738367616.png
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)
yogesh_3-1657738443073.png
See, the user attribute is updated as expected:
yogesh_4-1657738526122.png

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.

yogesh_5-1657739000026.png
(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:
yogesh_6-1657739172465.png

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:

yogesh_7-1657739784849.png
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:

yogesh_8-1657740076946.png

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.

 

Regards,
Avinash Chhetri