Hi,
I want to automatize the task to add new staff members as queue manager. I think to use REST2 API for that task.
First, i need to give the privileged right to the new user.
It’s easy, this curl command did the job (change the privileged value to 0 or 1 for give/remove the privileged right):
curl -X PUT -H “Content-Type: application/json” -d ‘{ “Privileged” = “1” }’ -H ‘Authorization: token 123456789’ -d " ‘https://mycorp.com/REST/2.0/users/joe’
Now the hard part is to give this same user the memberships to the staff group. I’m stuck to an error about JSON request an ARRAY:
curl -X PUT -H “Content-Type: application/json” -d ‘{ “Memberships”:[{“id”:“3867”,“type”:“group”,“_url”:“https://mycorp.com/REST/2.0/group/3867”}] }’ -H ‘Authorization: token 123456789’ ‘https://mycorp.com/REST/2.0/user/joe/groups/’
Error: {“message”:“JSON object must be a ARRAY”}
I dont know what i did wrong. Any advice?
My instance is on RT 5.0.4 with PostgreSQL 13 on Debian 11.
Kind regards,