Solved

Adding/removing access for Site Admin via API


Userlevel 2

I have 2 GSM Console Admins (Super Admins), 1 Site-Admin, and 2 Sites. The 1 Site admin has administrator access to both sites. I want to use the API to update their access to either No Access or View Only. When I use the endpoint “/service/api/console/gsm/{gsmKey}/sites/{siteId}/admins” (with the relevant info filled in), it’ll return a 204 but nothing updates for the Site Admin, their access stays the same.

If I attempt to provision either of the GSM Console Admins using the same endpoint and changing their access level to any of the 3 levels available, it’ll work. Judging by this in the API documentation “This API method allows adding existing GSM admins to the list of admins of a site, or modifying access permissions of already set up site admins. To get information about available admins, either query the list of admins on the GSM console (see here) or the list of admins on a site (see here),”, it seems that I should be able to change a site admins access permissions… unless I’m misunderstanding what it says.

Thanks.

icon

Best answer by shandley 9 June 2022, 14:45

View original

6 replies

Userlevel 2

Hi CSQA, 

 

Can I confirm that you’re first running a GET on /service/api/console/gsm/{gsmKey}/sites/{siteId}/admins to retrieve the site admins UserID

Then running a PUT to exactly the same URI with the following information:

 

{  "Admins": [    {      "UserId": "userId",      "AccessLevel": 1    }  ]}      

 

Userlevel 2

Hi CSQA, 

 

Can I confirm that you’re first running a GET on /service/api/console/gsm/{gsmKey}/sites/{siteId}/admins to retrieve the site admins UserID

Then running a PUT to exactly the same URI with the following information:

 

{  "Admins": [    {      "UserId": "userId",      "AccessLevel": 1    }  ]}      

 

That is correct. Just to verify, I ran it one more time just in case and it’ll still return a 204 when attempting to update a Site Admin, but when I look at the console, their permissions haven’t changed.

Userlevel 2

Hi CSQA, 

 

Can I confirm that you’re first running a GET on /service/api/console/gsm/{gsmKey}/sites/{siteId}/admins to retrieve the site admins UserID

Then running a PUT to exactly the same URI with the following information:

 

{  "Admins": [    {      "UserId": "userId",      "AccessLevel": 1    }  ]}      

 

That is correct. Just to verify, I ran it one more time just in case and it’ll still return a 204 when attempting to update a Site Admin, but when I look at the console, their permissions haven’t changed.

Thanks CSQA, let me look into this. Is it ok if I message you directly to get more details should I need to?

Userlevel 2

Hi CSQA, 

 

Can I confirm that you’re first running a GET on /service/api/console/gsm/{gsmKey}/sites/{siteId}/admins to retrieve the site admins UserID

Then running a PUT to exactly the same URI with the following information:

 

{  "Admins": [    {      "UserId": "userId",      "AccessLevel": 1    }  ]}      

 

That is correct. Just to verify, I ran it one more time just in case and it’ll still return a 204 when attempting to update a Site Admin, but when I look at the console, their permissions haven’t changed.

Thanks CSQA, let me look into this. Is it ok if I message you directly to get more details should I need to?

Yeah absolutely. I appreciate the help.

Userlevel 2

@shandley Hey Shandley, just wanted to follow up on this issue to see if you’ve made any progress on it? Thanks!

Userlevel 2

Hi CSQA, 

Thanks for providing further details. We were able to look deeper into the issue and I can confirm that the management of Site Admins is not currently supported through UnityAPI. 

However, it is something that we’ll be looking to enable support for soon.

In the mean time you should be able to manage the site admins from within the console. 

 

 

 

Reply