Webservice Account Aggregation

Hi,

below is the API response, I get from account aggregation and I’m able to do response mapping for username, displayName.
Can someone help me with response mapping for email, roles.


{
"Resources": \[

    {

        "userName": "Swathi.nath@dev.com",

        "displayName": "Swathi Nath",

        "emails": \[

            {

                "value": "Swathi.nath@dev.com",

                "type": "other",

                "primary": **true**

            }

        \],

        "roles": \[

            {

                "value": "Hourly Interacting User"

            },

            {

                "value": "User"

            },

            {

                "value": "Communicate - User"

            }

        \]

    },

    {

        "userName": "dravid.sagar@dev.com",

        "displayName": "Dravid Sagar",

        "emails": \[

            {

                "value": "dravid.sagar@dev.com",

                "type": "other",

                "primary": **true**

            },

            {

                "value": "dravid.sagar1@dev.com",

                "type": "other",

                "primary": **false**

            }

        \],

        "roles": \[

            {

                "value": "Wallboard User"

            },

            {

                "value": "employee"

            },

            {

                "value": "Trusted External User"

            }

        \]

    }

\]

}
```

Hello @chandramohan27 ,

The JSON Path for the emails as a multi-valued attribute is emails[*].valueHowever if you just want the primary you could use something like this emails[?(@.primary == true)].value.

The JSON Path for the roles as a multi-valued attribute is roles[*].value.

I hope this helps!

This also looks like a SCIM response - could you use the SCIM connector instead? Just curious

Hi @chandramohan27 , It seems like the API response you provided is not a valid JSON as it contains extra non-JSON content (** or \) , it should be valid JSON like :

{
    "Resources": [
        {
            "userName": "Swathi.nath@dev.com",
            "displayName": "Swathi Nath",
            "emails": [
                {
                    "value": "Swathi.nath@dev.com",
                    "type": "other",
                    "primary": true
                }
            ],
            "roles": [
                {
                    "value": "Hourly Interacting User"
                },
                {
                    "value": "User"
                },
                {
                    "value": "Communicate - User"
                }
            ]
        },
        {
            "userName": "dravid.sagar@dev.com",
            "displayName": "Dravid Sagar",
            "emails": [
                {
                    "value": "dravid.sagar@dev.com",
                    "type": "other",
                    "primary": true
                },
                {
                    "value": "dravid.sagar1@dev.com",
                    "type": "other",
                    "primary": false
                }
            ],
            "roles": [
                {
                    "value": "Wallboard User"
                },
                {
                    "value": "employee"
                },
                {
                    "value": "Trusted External User"
                }
            ]
        }
    ]
}

once the response is syntactically correct you can use SailPoint JSONpath Evaluator for finding the correct mapping for the multi-valued attributes.

so according to this response your root path will be $.Resources[*] . And then for emails and roles JSONpath need to map like $.emails[*].value Or $.roles[*].value
Hope, it will help you!

Note: With ** or \ in the API response Sailpoint will through ā€œis not valid JSONā€ kind of error and ISC will fail Aggregation before response mapping even starts.

Hi @chandramohan27 ,

On in your response mapping you would have something like:

  • userName → userName
  • displayName → displayName
  • email → emails[?(@.primary == true)].value
  • roles → roles[*].value

As noted by Mark, if your response structure follows the SCIM standard (with userName, emails, roles, etc.), you could also use the SCIM connector in ISC. This connector natively understands SCIM attributes and can simplify the mapping process compared to configuring everything manually.

Hope it helps.

1 Like