The following examples are relevant if you want to change the user role on a site level via API calls.
Before changing the API for user roles
Please note that you have to create and define the specific user roles in RAI before you can link to them in the API call. These can be defined by a RAI admin in Admin > Defaults and Settings > II Specific Limitations. Read more about how to create your own user roles right here.
The levels of user roles
There are three user role levels to be aware of when changing the user role of sites. The first level is the default user role which is default for all sites created and is defined by Mono. This is typically the Simple editing mode user role and it can't be changed by API.
The second level is changing the user role for a specific site. This can be changed both via API and RAI. The third level is changing a login link for a specific site - this will only affect the user role when using the exact link. Read more about the second and third level of changing user roles below.
Changing the site user role
If you want to change the user role for a specific site you can either update the user role in RAI or with an updateInfo API call. This user role change will affect all log ins to the specific site (except for entering the site from RAI).
POST https://hal.mono.net/api/v1/reseller/account/site
{
"command": "updateInfo",
"siteId": "1186617",
"siteUserGroups": "basic",
"userToken": "{{user_token}}"
}
Creating a login link with a different user role
If you want to change the user role for one specific entry to the site, you can create login link by specifying the user role required in siteUserGroups when generating the link. This overwrites both the default user role and the site specific user role but only for users that enter the site from that specific link.
POST https://hal.mono.net/api/v1/reseller/
{
"userToken": "{{user_token}}",
"command": "siteLogin",
"resellerId": 1, "siteId":1186617,
"siteUserGroups": "fulfillment",
"logoutUrl": "https://yourportal.com",
"userName": "Steve Cross”
}
Doesn't work?
Some subscriptions have locked user roles. This means that the user role can't be changed/affected in RAI or through an API call for sites using these subscriptions. This is the case for the following subscriptions:
- Oneclick_trial and Oneclick_locked: Will always show just global data and publish. Never the design tab.