Does context url in Web Service Connector support JSONPath filters?

Hi IDN Experts,

I am using the web service connector and I have a scenario about remove user from groups (Remove Entitlement operation). I have to make a GET request to get the group memberships for an identity and then call the DELETE request to remove the user from a group.

The GET request returns a full array of JSON objects {groupId, groupUserId} and the DELETE request requires the groupId and the groupUserId.

Is that possible to have the context url in the DELETE request to include a filter on the response array like below?
/app/group/$plan.groupId$/user/$response[?(@.groupId=="$plan.groupId$")].groupUserId$

I have tried a number of combinations but not able to find out a good way to filter the results from the first GET request. Here is a sample of the response

[
{"groupId": "193", "groupUserId": "AAA"},
{"groupId": "194", "groupUserId": "BBB"},
{"groupId": "195", "groupUserId": "CCC"}
]

The final endpoint to remove the group membership is like
DELETE /app/group/193/user/AAA

Any comments and suggestions are appreciated, thank you.

Ronald

Hi @ronaldchuiASB

I believe via UI this could be challenging to implement but if you are flexible to make use of the webServiceAfterOperation rule then you may achieve it.

There you can make API call first to get all the assignments of the user in back-end and then filter it using java code using json expression and then make another call to remove those access.

I hope this helps.

Regards
Vikas.

1 Like

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