Submitted by antoine.mottier on Mon, 08/28/2017 - 14:38
Only a user is associated with a session. So you need to retrieve user membership (including the group information) using a GET request such as: /API/identity/membership?p=0&c=100&f=user_id%3d125&d=group_id
Submitted by romualdo.s.rs on Mon, 08/28/2017 - 14:43
I tried to use your query but it did not return anything, I tried something simpler:../API/identity/membership?p=0&c=100
But even so, nothing has been returned to me.
Submitted by antoine.mottier on Mon, 08/28/2017 - 14:53
I just test the following query using Bonita Studio and give the expected information about user group: http://localhost:23947/bonita/API/identity/membership?p=0&c=10&f=user_id%3d4&d=group_id
Note that 23947 is the port on my computer but usually default is 8080 and 4is the user id of walter.bates in my test organization.
Comments
Is it possible to find membership according to the username of the session?
I was able to get group and user information in the session, but I can not figure out how to access the user group that is in the session.
To get information from the user I did so:
../API/identity/user?p=0&c=100&f=userName={{session.user_name}}
To access information about groups:
../API/identity/group?p=0&c=100
The results are as follows:
User:
08:56:39.494","userName":"romualdo.santos","title":"Mr","created_by_user_id":"-1","enabled":"true","lastname":"Santos","last_connection":"2017-08-28 08:26:07.869","password":"","manager_id":"0","id":"101","job_title":"Programmer"
,"last_update_date":"2017-08-18 11:25:45.468"}
Group:
"description":"","parent_path":"","creation_date":"2017-08-18 11:04:28.846","id":"302","created_by_user_id":"-1","last_update_date":"2017-08-18 11:04:28.846"}]
From session information you can get the user id and then use it in your query to retrieve user memberships.
Could you give an example of how to get membership information by session user ID? I did not understand how to perform this query
Only a user is associated with a session. So you need to retrieve user membership (including the group information) using a GET request such as:
/API/identity/membership?p=0&c=100&f=user_id%3d125&d=group_id
I tried to use your query but it did not return anything, I tried something simpler:
../API/identity/membership?p=0&c=100
But even so, nothing has been returned to me.
I tried to replicate the query that is in the documentation just by changing the id of the user and even then nothing was returned to me:
/API/identity/membership?p=0&c=10&f=user_id%3d101&d=role_id
I tried to replicate the query that is in the documentation just by changing the id of the user and even then nothing was returned to me:
/API/identity/membership?p=0&c=10&f=user_id%3d101&d=role_id
I just test the following query using Bonita Studio and give the expected information about user group:
http://localhost:23947/bonita/API/identity/membership?p=0&c=10&f=user_id%3d4&d=group_id
Note that
23947
is the port on my computer but usually default is8080
and4
is the user id of walter.bates in my test organization.It worked, I missed my query, forgot to put the .. in the beginning of the query, thanks your help