What version of the Rest API are you using? Based on the location of this post, I am guessing that this is for Tableau Online so it should be for the current rev - and the documentation would be here - Reference-Tableau Server REST API - Tableau
Using "Viewer" should work fine but Interactor is not valid with the current api
The site role to assign to the user. You can assign the following roles: Creator, Explorer,ExplorerCanPublish, SiteAdministratorExplorer, SiteAdministratorCreator, Unlicensed, or Viewer.
Let us know if the newest code of the API with these role values is causing any sort of issue.
I have a similar issue going on. When I try to add a new user that has site_role = 'Creator', I receive a 400013: Bad Request error- Invalid Site role 'Creator'
I'm not sure why I'm receiving the error as the documentation for 3.3 states that Creator is a valid site role. I thought originally that the version of Rest API I was using wasn't compatible with the version of server we use (2019.1), but it looks like that's correct.
Whats also weird is that when I print off all of the site roles of users on our non-test site, I see plenty of Creator site roles being returned.
I was encountering a similar error as yours.
Explicitly calling out the Rest API version (3.3) associated with 2019.1, seems to take care of the bad request.
server.version = '3.3'
Tested with Tableau Server Client Library (Python) as part of Python script and was able to create user with desired role.
Checked the python library code, the API version defaults to 2.0. Creator/Viewer are newer roles, so maybe that's the reason for encountering the Bad Request message.
Hope your issue is already addressed.
Hello @Sunil Sharma or All,
I am looking for a simple python script to test site permission set. Could you please share one sample Python script?