# Web Services Connector - Entitlement aggregation - result with jsonarray as the root

**URL:** <https://developer.sailpoint.com/discuss/t/web-services-connector-entitlement-aggregation-result-with-jsonarray-as-the-root/2258>\
**Category:** SHF Discussion and Questions\
**Created:** [December 3, 2021, 3:12am UTC](https://developer.sailpoint.com/discuss/t/web-services-connector-entitlement-aggregation-result-with-jsonarray-as-the-root/2258 "2021-12-03T03:12:02Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![questjj](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/questjj/32/25216_2.png) [@questjj](https://developer.sailpoint.com/discuss/u/questjj)\
**Post date:** [December 3, 2021, 3:12am UTC](https://developer.sailpoint.com/discuss/t/web-services-connector-entitlement-aggregation-result-with-jsonarray-as-the-root/2258/1 "2021-12-03T03:12:02Z")

</div>

Hey everyone. I am trying to do something that should be pretty simple. I have a web services connector that will do the following

- aggregate group entitlement
- aggregate accounts
- aggregate accounts group memberships (entitlements)

My source API for the groups is an array at the root, it looks like this:

```auto
[

    {
        "name": "ABC",
        "description": "Blah Falls",
        "code": "ABC",
        "linesOfCare": [
            "HomeHealth"
        ],
        "dateCreated": "2021-03-10T14:30:04.82Z",
        "dateUpdated": "2021-03-10T14:30:04.82Z",
        "id": "1233"
    },
    {
        "name": "Test Security Group",
        "description": " ",
        "code": "TEST_SECURITY_GROUP",
        "linesOfCare": [
            "HomeHealth"
        ],
        "dateCreated": "2021-03-10T14:29:09.08Z",
        "dateUpdated": "2021-03-10T14:29:09.08Z",
        "id": "1234"
    }
]

```

In my response configuration, I’ve tried a million different response mapping combos, trying to retrieve the “id” from this jsonarray. Only time I was able to pull an id is if I limit my response to the first element in the array in via a root path of $[0]. Has anyone solved this? Seems pretty basic, thanks for any help. Below is what I would expect to be a logical jsonpath solution.

 ![image](https://global.discourse-cdn.com/sailpoint/original/1X/68373f9ee12c44f81c8327f47404fc23af569c48.png)  
 ![image](https://global.discourse-cdn.com/sailpoint/original/1X/afc8321b908882593c2bfc03f7e2c93ed34ca30e.png)

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [December 3, 2021, 1:15pm UTC](https://developer.sailpoint.com/discuss/t/web-services-connector-entitlement-aggregation-result-with-jsonarray-as-the-root/2258/2 "2021-12-03T13:15:04Z")

</div>

Hi @questjj ,

Response mapping in web service connector users Goessner JSON Path. Try this:

```auto
*.id

```

I pasted your sample into [https://jsonpath.herokuapp.com/](https://jsonpath.herokuapp.com/) and selected the **Goessner** output type. You can find information about Goessner JSON Path online, and we also have some [documentation in our portal](https://developer.sailpoint.com/triggers/filtering_event_triggers.html#filter-syntax).

---

<div class="post-metadata">

**Author:** ![questjj](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/questjj/32/25216_2.png) [@questjj](https://developer.sailpoint.com/discuss/u/questjj)\
**Post date:** [December 3, 2021, 2:21pm UTC](https://developer.sailpoint.com/discuss/t/web-services-connector-entitlement-aggregation-result-with-jsonarray-as-the-root/2258/3 "2021-12-03T14:21:53Z")

</div>

Thanks Colin, knowing its Goesner will help in the future im sure. However, still not picking up this entitlement using \*.id for response mapping and $ for root path. Any other ideas?

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [December 3, 2021, 2:51pm UTC](https://developer.sailpoint.com/discuss/t/web-services-connector-entitlement-aggregation-result-with-jsonarray-as-the-root/2258/4 "2021-12-03T14:51:36Z")

</div>

Try using `*` as the **Root Path** and `id` as the **attribute path**.

The **Root Path** defines a prefix that will be applied to all of your **Attribute Paths**. So a **Root Path** of `*` and **Attribute Path** of `id` will condense to `*.id` when the connector evaluates the logic. If your **Root Path** is `$` and your **Attribute Path** is `*.id`, it will evaluate to `$.*.id`, which isn’t valid JSON path.

---

<div class="post-metadata">

**Author:** ![questjj](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/questjj/32/25216_2.png) [@questjj](https://developer.sailpoint.com/discuss/u/questjj)\
**Post date:** [December 3, 2021, 3:30pm UTC](https://developer.sailpoint.com/discuss/t/web-services-connector-entitlement-aggregation-result-with-jsonarray-as-the-root/2258/5 "2021-12-03T15:30:36Z")

</div>

No luck. The only way I’ve got anything to link is grabbing only one item in the array

$.[0] And id

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [December 3, 2021, 4:12pm UTC](https://developer.sailpoint.com/discuss/t/web-services-connector-entitlement-aggregation-result-with-jsonarray-as-the-root/2258/6 "2021-12-03T16:12:29Z")

</div>

Ok, I think I have it. I implemented a web service connector that returns an array for account aggregation. The API for the source returns the following:

```json
[
  {
    "id": 0,
    "username": "string",
    "name": "string",
    "avatar_template": "string",
    "email": "string",
    "secondary_emails": [
      null
    ],
    "active": true,
    "admin": true,
    "moderator": true,
    "last_seen_at": "string",
    "last_emailed_at": "string",
    "created_at": "string",
    "last_seen_age": 0,
    "last_emailed_age": 0,
    "created_at_age": 0,
    "trust_level": 0,
    "manual_locked_trust_level": "string",
    "flag_level": 0,
    "title": "string",
    "time_read": 0,
    "staged": true,
    "days_visited": 0,
    "posts_read_count": 0,
    "topics_entered": 0,
    "post_count": 0
  }
]

```

Here is what I did to get the attributes of each array item:

 ![image](https://global.discourse-cdn.com/sailpoint/original/1X/96b5419964e2ce6981b8b04c98f6577a68a5429b.png)

 ![image](https://global.discourse-cdn.com/sailpoint/original/1X/dbb74e29e55a3ceaba08f4ee02822a1950f0db59.png)

---

<div class="post-metadata">

**Author:** ![questjj](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/questjj/32/25216_2.png) [@questjj](https://developer.sailpoint.com/discuss/u/questjj)\
**Post date:** [December 3, 2021, 4:44pm UTC](https://developer.sailpoint.com/discuss/t/web-services-connector-entitlement-aggregation-result-with-jsonarray-as-the-root/2258/7 "2021-12-03T16:44:10Z")

</div>

Add to your test, a second account aggregation that retrieves an array of entitlements, and pull all entitlements into a multivalued entitlement column. Thats the problem im facing.

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [December 3, 2021, 5:02pm UTC](https://developer.sailpoint.com/discuss/t/web-services-connector-entitlement-aggregation-result-with-jsonarray-as-the-root/2258/8 "2021-12-03T17:02:25Z")

</div>

I think I have that one too 🙂

After my first account aggregation, I get a list of user IDs. I need to use these user IDs to call a separate endpoint to get each user’s multi valued entitlements. My second account aggregation uses the **Parent Endpoint** tab to configure this.

Here is what the second API returns:

```json
{
  "id": 0,
  "username": "string",
  "name": "string",
  ...
  ...
  ...
  "groups": [
    {
      "id": 0,
      "automatic": true,
      "name": "string",
      "display_name": "string",
      ...
    }
  ]
}

```

Here is how I configured **Account Aggregation 2** to aggregate the groups as multivalued entitlements for each user.

 ![image](https://global.discourse-cdn.com/sailpoint/original/1X/9e2b1b440865eed1a43ecb753ce9e9d46d56f235.png)

 ![image](https://global.discourse-cdn.com/sailpoint/original/1X/796b6b1f760c776c2fea2979e6e96c1a613435b5.png)

 ![image](https://global.discourse-cdn.com/sailpoint/original/1X/8d9fe5a1e45c7a2397ef9dfdd46a8e9dd1b83d27.png)

 ![image](https://global.discourse-cdn.com/sailpoint/original/1X/ca5c1d545e4d597b30cadc1fe599cd7b7287a2c5.png)

---

<div class="post-metadata">

**Author:** ![questjj](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/questjj/32/25216_2.png) [@questjj](https://developer.sailpoint.com/discuss/u/questjj)\
**Post date:** [December 3, 2021, 5:14pm UTC](https://developer.sailpoint.com/discuss/t/web-services-connector-entitlement-aggregation-result-with-jsonarray-as-the-root/2258/9 "2021-12-03T17:14:55Z")

</div>

Close! Try to do it with a groups array that doesnt have have a “groups” node. just

[  
{  
“id”: 0,  
“automatic”: true,  
“name”: “string”,  
“display\_name”: “string”,  
…  
},  
{  
“id”: 1,  
“automatic”: true,  
“name”: “string1”,  
“display\_name”: “string”,  
…  
}, …  
]

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [December 3, 2021, 8:24pm UTC](https://developer.sailpoint.com/discuss/t/web-services-connector-entitlement-aggregation-result-with-jsonarray-as-the-root/2258/10 "2021-12-03T20:24:45Z")

</div>

That should just be a root path of $ and attribute path of id

---

<div class="post-metadata">

**Author:** ![questjj](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/questjj/32/25216_2.png) [@questjj](https://developer.sailpoint.com/discuss/u/questjj)\
**Post date:** [December 3, 2021, 9:06pm UTC](https://developer.sailpoint.com/discuss/t/web-services-connector-entitlement-aggregation-result-with-jsonarray-as-the-root/2258/11 "2021-12-03T21:06:59Z")

</div>

that was the first thing I tried. If you get a chance, see if you can get it to work from your sample project.

---

<div class="post-metadata">

**Author:** ![questjj](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/questjj/32/25216_2.png) [@questjj](https://developer.sailpoint.com/discuss/u/questjj)\
**Post date:** [December 6, 2021, 2:11pm UTC](https://developer.sailpoint.com/discuss/t/web-services-connector-entitlement-aggregation-result-with-jsonarray-as-the-root/2258/12 "2021-12-06T14:11:17Z")

</div>

abandoning ship and going custom connector.

---

<div class="post-metadata">

**Author:** ![mcheek](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/mcheek/32/23705_2.png) [@mcheek](https://developer.sailpoint.com/discuss/u/mcheek)\
**Post date:** [February 18, 2022, 4:22pm UTC](https://developer.sailpoint.com/discuss/t/web-services-connector-entitlement-aggregation-result-with-jsonarray-as-the-root/2258/13 "2022-02-18T16:22:17Z")

</div>

hey @colin_mckibben I have a similar path I’m trying to go down

Here is the json when you ask for the group membership of a specific user

```auto
{
    "header": {
        "relationships": [
            "SysGroup",
            "SysRole",
            "SysUser",
            "SysUser",
            "SysGroupPermission",
            "SysGroup"
        ],
        "query_rows": 1,
        "sort_order": [
            "me.update_ts",
            "me.rel_id"
        ],
        "primary_key": [
            "rel_id"
        ],
        "data_rows": 1
    },
    "data": [
        {
            "rel_id": 169,
            "group_id": 121,
            "create_ts": "2022-02-17 15:11:18.215613+00",
            "update_user": 254,
            "create_user": 254,
            "role_id": null,
            "user_id": 255,
            "update_ts": "2022-02-17 15:11:18.215613+00"
        }
    ]
}

```

And here is what my configuration looks like

Context URL

```auto
/api/v1/user_group?user_id=$response.user_id$

```

Root path

```auto
$.data

```

Response Mapping

Schema attribute Attribute Path  
entitlements [\*].group\_id

And here’s my account schema

 ![image](https://global.discourse-cdn.com/sailpoint/original/1X/5d429aff46c355f1170d2921c3cdb3e2fda0c4be.png)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [July 19, 2023, 2:22pm UTC](https://developer.sailpoint.com/discuss/t/web-services-connector-entitlement-aggregation-result-with-jsonarray-as-the-root/2258/16 "2023-07-19T14:22:20Z")

</div>


