Self answer, i havent clearly read the documentation :
PUT /group/:id/members add members to a group; provide a JSON array of principal ids
PUT /user/:name/groups add a user to groups; provide a JSON array of groups ids
First give privileged right to a user because i want give them the right to manage a queue:
curl -X PUT -H “Content-Type: application/json” -d ‘{ “Privileged” : “1” }’ -H ‘Authorization: token 123456789’ ‘https://mycorp.org/REST/2.0/user/joe’
Then add my user joe to the group. Their is 2 way( I need to know the id of user or id of the group first).
I this exemple my user “joe” id is 898 and my group id is 3867.
First way:
curl -X PUT -H “Content-Type: application/json” -d ‘[“3867”]’ -H ‘Authorization: token 123456789’ ‘https://mycorp.org/REST/2.0/user/joe/groups’
Second way:
curl -X PUT -H “Content-Type: application/json” -d ‘[“898”]’ -H ‘Authorization: token 123456789’ ‘https://mycorp.org/REST/2.0/group/3867/members’