Response Mapping's Attribute Path when JSON response is an array of strings?

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.

My response’s Root Path is set to blank.

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:

Matt

The response is JSON.

Is it doable without the After Operation Rule?

If it is JSON, then yes, I would expect you could do this without a rule.

Can you share the full JSON response? (sanitized, of course)

Hi @ywomiloju,

Great question and welcome to the community!

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.

Example: -



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:

{
  "userId": "1234",
  "roles": ["admin", "user", "analyst"]
}

Then also the above should work as you are mapping roles in Attribute Path.

If response is like:

{
  "roles": [
    { "name": "admin" },
    { "name": "user" }
  ]
}

You’d use a more specific Root Path:

$.roles[*]

Always preview the response from your endpoint in Postman when possible and verify what root element is returned. Usually$ or $[*] works.

If aggregation still returns empty, double-check your account schema field roles is marked as multi: true.

Good luck mate.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.