Skip to main content
Contributor ⭐️
June 24, 2020
Solved

Can you add or change the Custom role though an API?

  • June 24, 2020
  • 13 replies
  • 620 views

I need to change the Custom Role for a large group of users, I like to do this through a scripted API call.

No it looks like that the Custom Role is not a field that you can use to fetch users and you also can’t add or change that filed.

 

Or am I doing something wrong and do I need to read better :)

iMac-van-Ron:python ron$ curl -H 'Authorization: Bearer <TOKEN>' -X PUT https://api2-eu-west-1.almostinsided.com/user/{UserID}/role/'Extreme Hero'
This action is only available for fields:email,oracle_sso_id,token_sso_id,openidconnect_sso_id,facebook_sso_id,janrain_sso_id,saml_sso_id,linkedin_sso_id,username,oauth2_sso_id,avatar

 

/Ron

 

 

    Best answer by daniel.boon

    @RonH @mstone 

    It’s now possible to remove custom user roles via API :) https://api2-eu-west-1.insided.com/docs/user/#operation/revokeRole

    13 replies

    Blastoise186
    Helper ⭐️⭐️⭐️
    July 21, 2021

    I think I know the solution there @alexandra.culler .

    Depending on the language your code is in, you may need to use a placeholder such as putting the Supported User reference in either double quotes or doing it as something like Supported%20User as %20 is a placeholder for space. There’s usually a way of doing it somehow! It could also be a bug though.

    Bug blasting absolutely everything... The Blastoise Way
    Helper ⭐️⭐️
    July 21, 2021

    Thanks @Blastoise186 but I have tried a few different methods like the one you suggest. We used quotation marks and apostrophes. We used spaces, %20, “-”, and “+”. None of these have worked so far :(.

    daniel.boon
    Helper ⭐️⭐️⭐️
    July 22, 2021

    Hey @alexandra.culler - it seems that support believe this may be a bug (thanks for raising it to them!). Support will keep you up to date on how to solve this :).

    inSided product alumnus