I am configuring the Web Services connector for an old IBM application, where the Rest API is a wrapper for command line commands. To load the accounts, I am able to get the User details by calling the /users endpoint. But I also need the user’s roles which is in the /userRoles endpoint. When I call the userRoles endpoint, child HTTP Operation, I get something like this [“admin”, “user”, “analyst”]. What can I set the attribute path to so that my roles attribute will have list of the roles.
My account schema has a roles attributes which is multivalued and is a string. (Schema attribute: roles)
I have tried setting the path to (without quotes): “.”, “*”, “” (empty string is not allowed). Each time, when I look at the account’s roles attribute after successful aggregation, it is empty.
If the API response is neither JSON nor XML, you will probably need to use an after operation rule.
In the response mapping, make sure to include your roles attribute, but the path doesn’t matter. In the rule, use the rawResponseObject (API response before any response mapping is applied) to update the value in the processedResponseObject (the data that ISC uses to populate the attributes).
The example in the documentation is already going in that exact direction and just needs to be updated for your specific case:
When your JSON response is an array of strings and your target schema attribute is multivalued (e.g., roles as type: STRING, multi: true), you can map this directly. The trick lies in the Root Path and Attribute Path configuration within the child HTTP operation.
Since the you mentioned the entire response is an array (not wrapped in a JSON object), you can use the below in Root Path and directly map roles in Attribute Path:
$ or $[*] or "$"
This tells SailPoint to take the full array and map it directly to the roles attribute on the account.
If you get a nested structure like below in response from the API: