Add users to role with API

Hello, I am using the BigFix REST API to add new operators, display the roles they are in, and delete them. I am having issues adding operators to roles though and cannot find any documentation.

when I look at /api/role/{roleID} I see information about the role including an Operators block in the xml like op name

How can I add a new operator to this block? Can I just POST to /api/role/{roleID} with the updated role xml containing a new operator in the Operators block? I’m getting an error that way but is this even possible?

This works for me

root@bfbionics5:~/rest# curl -s -k --user BFAdmin https://<redacted>:52311/api/role/3535 > 3535.xml Enter host password for user 'BFAdmin':

Edit xml and add/remove operators
root@bfbionics5:~/rest# vi 3535.xml

root@bfbionics5:~/rest# curl -s -k --user BFAdmin -d @3535.xml -X POST https://<redacted>:52311/api/role/3535 Enter host password for user 'BFAdmin': Ok

root@bfbionics5:~/rest#

1 Like

Thank you, what exactly are you posting to the server? The exact xml the server returns from the GET request plus your added operators in the block?

yes, keep the entire XML and only change the operators block

Thank you, I was sending the wrong header. Appreciate the sanity check! Documentation is pretty sparse so it’s appreciated!