# Add-entitlement in http operations for webservice connector

**URL:** <https://developer.sailpoint.com/discuss/t/add-entitlement-in-http-operations-for-webservice-connector/129179>\
**Category:** SHF Discussion and Questions\
**Tags:** webservice-connector, identity-security-cloud\
**Created:** [May 16, 2025, 8:41am UTC](https://developer.sailpoint.com/discuss/t/add-entitlement-in-http-operations-for-webservice-connector/129179 "2025-05-16T08:41:51Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoakimSandin](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@JoakimSandin](https://developer.sailpoint.com/discuss/u/JoakimSandin)\
**Post date:** [May 16, 2025, 8:41am UTC](https://developer.sailpoint.com/discuss/t/add-entitlement-in-http-operations-for-webservice-connector/129179/1 "2025-05-16T08:41:51Z")

</div>

We are trying to add a entitlement for a user. We are using webservice-connector to our Onelogin(idp) tennant but we are always getting this error.

```auto
["[ConnectorError] HttpClientWrapper.ts Response status :400 doesn\u0027t match to allowed success codes : 2 **,2** ,2** \n response : {\"status\":400,\"error\":\"BadRequestError\",\"description\":\"Expected array in request\"} (requestId: 6d1de6724ad94850bfe72232bdfe697c)"]

```

The api for add a rule(entitlement) in Onelogin looks like this

```auto
curl 'https://<subdomain>/api/2/roles/:id/users' \
-X POST \
-H "Authorization: bearer <access_token>" \
-H "Content-Type: application/json" \
-d '[123, 456, 789]'

```

The Http-operation we are trying looks like this in the body  
[  
“$getObject.nativeIdentity$”  
]  
and the context url looks like this  
/api/2/roles/$plan.OneloginRoleID$/users

when I am looking in the CLI logs the context url is correct but it is always says that it expects a array. The “[…]” should indicate it is an array even if it is only one value.

Has anyone come across this?

/Regards

---

<div class="post-metadata">

**Author:** ![sidharth\_tarlapally](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/sidharth_tarlapally/32/26178_2.png) [@sidharth\_tarlapally](https://developer.sailpoint.com/discuss/u/sidharth_tarlapally)\
**Post date:** [May 16, 2025, 8:57am UTC](https://developer.sailpoint.com/discuss/t/add-entitlement-in-http-operations-for-webservice-connector/129179/2 "2025-05-16T08:57:49Z")

</div>

Hello @JoakimSandin

Is entitlement attribute , mapped as multi-valued ?

---

<div class="post-metadata">

**Author:** ![JoakimSandin](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@JoakimSandin](https://developer.sailpoint.com/discuss/u/JoakimSandin)\
**Post date:** [May 16, 2025, 9:08am UTC](https://developer.sailpoint.com/discuss/t/add-entitlement-in-http-operations-for-webservice-connector/129179/3 "2025-05-16T09:08:33Z")

</div>

Yes it is set as Multi-valued

---

<div class="post-metadata">

**Author:** ![vguleria](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/vguleria/32/7884_2.png) [@vguleria](https://developer.sailpoint.com/discuss/u/vguleria)\
**Post date:** [May 16, 2025, 9:25am UTC](https://developer.sailpoint.com/discuss/t/add-entitlement-in-http-operations-for-webservice-connector/129179/4 "2025-05-16T09:25:20Z")

</div>

Hi @JoakimSandin

Did you check the VA logs if the web service connector is not strigyfying the array body may be that is what causing the issue.  
You can try to set the log level to debug and then see what the request body is. Generally I have seen in the web service connector when you are passing json body, the connector expects the body to be key value pairs and if the value is not found then it simply removes the entire line in the request.  
So can you please double check in VA logs what is the actual body being passed. If it is blank, then may be you might need to write small rule to make this work.

I hope this helps, please let me know if it works.

Thank You.  
Regards  
Vikas.

---

<div class="post-metadata">

**Author:** ![JoakimSandin](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@JoakimSandin](https://developer.sailpoint.com/discuss/u/JoakimSandin)\
**Post date:** [May 20, 2025, 12:32pm UTC](https://developer.sailpoint.com/discuss/t/add-entitlement-in-http-operations-for-webservice-connector/129179/5 "2025-05-20T12:32:42Z")

</div>

This is from the log

```auto
DEBUG | connectorMessage ▶︎ {"AppType":"Web Services SaaS","commandType":"std:account:update","invocationId":"75d08c1b-6355-4e54-990f-a0011925b195","message":"BaseHttpRequestBuilder.ts Entering prepareRawBody() for : [\n\"user_id\": \"$getObject.nativeIdentity$\"\n]","requestId":"1d86972739944399ad967b755789ec80","timestamp":"2025-05-20T12:25:29.770Z","version":37}

```

As i can see it, it sends an array even if it is only one key:value pair

[\n"user\_id": "$getObject.nativeIdentity$"\n]

---

<div class="post-metadata">

**Author:** ![JoakimSandin](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@JoakimSandin](https://developer.sailpoint.com/discuss/u/JoakimSandin)\
**Post date:** [May 20, 2025, 12:37pm UTC](https://developer.sailpoint.com/discuss/t/add-entitlement-in-http-operations-for-webservice-connector/129179/6 "2025-05-20T12:37:11Z")

</div>

Some more from the log

```auto
{"AppType":"Web Services SaaS","commandType":"std:account:update","invocationId":"75d08c1b-6355-4e54-990f-a0011925b195","message":"BaseHttpRequestBuilder.ts Attempting to extract placeholders from: [\n\"user_id\": \"$getObject.nativeIdentity$\"\n]","requestId":"1d86972739944399ad967b755789ec80","timestamp":"2025-05-20T12:25:29.770Z","version":37}
[2025-05-20T14:25:30.274+02:00] DEBUG | connectorMessage ▶︎ {"AppType":"Web Services SaaS","commandType":"std:account:update","invocationId":"75d08c1b-6355-4e54-990f-a0011925b195","message":"BaseHttpRequestBuilder.ts Entering determinePlaceholderValue()...","requestId":"1d86972739944399ad967b755789ec80","timestamp":"2025-05-20T12:25:29.770Z","version":37}
[2025-05-20T14:25:30.274+02:00] DEBUG | connectorMessage ▶︎ {"AppType":"Web Services SaaS","commandType":"std:account:update","invocationId":"75d08c1b-6355-4e54-990f-a0011925b195","message":"determinePlaceholderValue for: nativeIdentity","requestId":"1d86972739944399ad967b755789ec80","timestamp":"2025-05-20T12:25:29.770Z","version":37}
[2025-05-20T14:25:30.274+02:00] DEBUG | connectorMessage ▶︎ {"AppType":"Web Services SaaS","commandType":"std:account:update","invocationId":"75d08c1b-6355-4e54-990f-a0011925b195","message":"determinePlaceholderValue for from planAttributes: nativeIdentity","requestId":"1d86972739944399ad967b755789ec80","timestamp":"2025-05-20T12:25:29.770Z","version":37}
[2025-05-20T14:25:30.274+02:00] DEBUG | connectorMessage ▶︎ {"AppType":"Web Services SaaS","commandType":"std:account:update","invocationId":"75d08c1b-6355-4e54-990f-a0011925b195","message":"BaseHttpRequestBuilder.ts Exiting determinePlaceholderValue()...","requestId":"1d86972739944399ad967b755789ec80","timestamp":"2025-05-20T12:25:29.770Z","version":37}
[2025-05-20T14:25:30.274+02:00] DEBUG | connectorMessage ▶︎ {"AppType":"Web Services SaaS","commandType":"std:account:update","invocationId":"75d08c1b-6355-4e54-990f-a0011925b195","message":"BaseHttpRequestBuilder.ts Exiting buildBody()...","requestId":"1d86972739944399ad967b755789ec80","timestamp":"2025-05-20T12:25:29.770Z","version":37}
[2025-05-20T14:25:30.274+02:00] DEBUG | connectorMessage ▶︎ {"AppType":"Web Services SaaS","commandType":"std:account:update","invocationId":"75d08c1b-6355-4e54-990f-a0011925b195","message":"JsonRequestBuilder.ts Exiting buildBody()...","requestId":"1d86972739944399ad967b755789ec80","timestamp":"2025-05-20T12:25:29.770Z","version":37}
[2025-05-20T14:25:30.274+02:00] DEBUG | connectorMessage ▶︎ {"AppType":"Web Services SaaS","commandType":"std:account:update","invocationId":"75d08c1b-6355-4e54-990f-a0011925b195","message":"ExecutionMediator.ts processEndpoint: Attempting to trigger request for\"\n + \" endpoint Add entitelment at: https://xxxxxx.onelogin.com/api/2/roles/$plan.OneloginRoleID$/users","requestId":"1d86972739944399ad967b755789ec80","timestamp":"2025-05-20T12:25:29.770Z","version":37}

```

---

<div class="post-metadata">

**Author:** ![sidharth\_tarlapally](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/sidharth_tarlapally/32/26178_2.png) [@sidharth\_tarlapally](https://developer.sailpoint.com/discuss/u/sidharth_tarlapally)\
**Post date:** [May 20, 2025, 1:25pm UTC](https://developer.sailpoint.com/discuss/t/add-entitlement-in-http-operations-for-webservice-connector/129179/7 "2025-05-20T13:25:37Z")

</div>

@JoakimSandin

What is the payload for the api call , what are we sending in add entitlement body ..

---

<div class="post-metadata">

**Author:** ![JoakimSandin](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@JoakimSandin](https://developer.sailpoint.com/discuss/u/JoakimSandin)\
**Post date:** [May 20, 2025, 2:00pm UTC](https://developer.sailpoint.com/discuss/t/add-entitlement-in-http-operations-for-webservice-connector/129179/8 "2025-05-20T14:00:06Z")

</div>

![image](https://global.discourse-cdn.com/sailpoint/original/3X/7/e/7ec3950c7a49f21439182c5d811add29f312e863.png)

---

<div class="post-metadata">

**Author:** ![sidharth\_tarlapally](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/sidharth_tarlapally/32/26178_2.png) [@sidharth\_tarlapally](https://developer.sailpoint.com/discuss/u/sidharth_tarlapally)\
**Post date:** [May 20, 2025, 3:20pm UTC](https://developer.sailpoint.com/discuss/t/add-entitlement-in-http-operations-for-webservice-connector/129179/9 "2025-05-20T15:20:19Z")

</div>

Here’s a more polished and professional rephrasing:

* * *

@JoakimSandin

I’m not quite sure why you’re using `$getObject.nativeIdentity$` instead of `$plan.entitlementIDAttribute$`.

Based on the input you’ve provided, the request body for the “Add Entitlement” API doesn’t include a `"user_id"` attribute.

Could you try using the following in the request body instead?

```auto
$plan.entitlementIDAttribute$

```

Also, please avoid using square brackets (`[]`) in the body.

---

<div class="post-metadata">

**Author:** ![JoakimSandin](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@JoakimSandin](https://developer.sailpoint.com/discuss/u/JoakimSandin)\
**Post date:** [May 21, 2025, 5:45am UTC](https://developer.sailpoint.com/discuss/t/add-entitlement-in-http-operations-for-webservice-connector/129179/10 "2025-05-21T05:45:00Z")

</div>

The api call need to have the entitlement ID in the URI and the users ID that are getting the entitlement in the body. The bodd needs also be an array therfore i use the brackets to indicate that is a array.

What value has the plan.entitlementIDAttribute? Is it the id of the entitlement?

Here is the api that we are trying to use

> **[Add Role Users - OneLogin API](https://developers.onelogin.com/api-docs/2/roles/add-role-users)**

 ![Screenshot from 2025-05-21 07-51-03](https://global.discourse-cdn.com/sailpoint/original/3X/9/1/9116a45e4540fd37655516fc3ce7a1ff8aa89c2c.png)  
 ![Screenshot from 2025-05-21 07-50-28](https://global.discourse-cdn.com/sailpoint/original/3X/8/8/88f6ff6bf69b36546162b4e8b007e14174a95847.png)

---

<div class="post-metadata">

**Author:** ![sidharth\_tarlapally](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/sidharth_tarlapally/32/26178_2.png) [@sidharth\_tarlapally](https://developer.sailpoint.com/discuss/u/sidharth_tarlapally)\
**Post date:** [May 21, 2025, 6:22am UTC](https://developer.sailpoint.com/discuss/t/add-entitlement-in-http-operations-for-webservice-connector/129179/11 "2025-05-21T06:22:34Z")

</div>

Hi @JoakimSandin,

Thanks for sharing the document reference — that really helped clarify things.

Based on my review of the API documentation, it looks like the `user_id`s are of type `INT` and are expected in the request **body** , while the `role_id` is passed in the **URL**. So you’re partially correct. However, there’s one adjustment needed: the **body** of the API call.

The correct body format should look like this:

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/4/d/4d62ff65936c2c01be5ddd2b76c3e1d5db114998.png)

But currently, the composed body looks like this:

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/7/e/7ec3950c7a49f21439182c5d811add29f312e863.png)

Which would result in a body like:

```auto
[
  "user_id": "123"
]

```

Assuming `123` is the **nativeIdentity**.

To fix this, we need to check two things:

1. The `user_id` attribute in the Account Schema must be of type `INT`, not `String`:  
 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/6/d/6d46990d3ad46a1ecef6d1cf4daab669f8dd0beb.png)
2. The body should be composed like this:

```auto
[$plan.nativeIdentity$]

```

This will result in the expected body format:

```auto
 [123]

```

This is based on curl command that is provided in the documentation .

Hope this helps!

---

<div class="post-metadata">

**Author:** ![Tulasi](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/tulasi/32/34596_2.png) [@Tulasi](https://developer.sailpoint.com/discuss/u/Tulasi)\
**Post date:** [May 21, 2025, 6:24am UTC](https://developer.sailpoint.com/discuss/t/add-entitlement-in-http-operations-for-webservice-connector/129179/12 "2025-05-21T06:24:01Z")

</div>

Hi joakim ,  
I am not sure whether this works or not from the scenario u said I think if the body is like this this may work  
{  
“user\_id”: [  
$getObject.nativeIdentity$ or $plan.nativeIdentity$  
]  
}  
Thanks  
Tulasi

---

<div class="post-metadata">

**Author:** ![JoakimSandin](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@JoakimSandin](https://developer.sailpoint.com/discuss/u/JoakimSandin)\
**Post date:** [May 26, 2025, 6:28am UTC](https://developer.sailpoint.com/discuss/t/add-entitlement-in-http-operations-for-webservice-connector/129179/13 "2025-05-26T06:28:49Z")

</div>

Thanks!  
That solved it, I needed only to add a get-object Http operation also so it could aggregate a single account.

Regards  
/Joakim

---

<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 25, 2025, 6:28am UTC](https://developer.sailpoint.com/discuss/t/add-entitlement-in-http-operations-for-webservice-connector/129179/14 "2025-07-25T06:28:59Z")

</div>

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