Bulk add/remove roles using the REST API
Friday, October 11, 2019 at 04:09amI'm trying to update all the roles such as adding and removing a few of them with one API call. I tried:
PUT /api/packages/{packageId}/roles... but I get "500 Internal Server Error". I also tried to simply update the package with only the roles attribute filled when making the API call to
PUT /api/packages/{packageId}... I don't get any errors but the roles have not been updated. My guess is that I need to have an API call for each add/remove that I need to do. Is that my only option? Thanks.
Reply to: Bulk add/remove roles using the REST API
Friday, October 11, 2019 at 05:26amPUT /api/packages/{packageId}/roles
call. After I checked our backend source code, I found out that this API can only be used for reordering signer and will only take the existing role ID and index number, any payload other than that may cause an internal exception thrown, and therefore you saw the 500 error (uncatalogued exception). This is from my best understanding of this API. I also found the API description a little bit confusing, so if you want, I can create a support ticket asking for clarification. ForPUT /api/packages/{packageId}
API, it will only process package level fields. Not updating "roles" node should be expected. Hope this could help! Duo