API_ChangeUserRole

Overview

Use API_ChangeUserRole to assign a user to a new role, to upgrade or downgrade access, or simply to move the user to a different role.

You can also use this call to assign the user to a special role called None (role id 9) which removes the user's access to the application. Use the None role if you want to disable access while retaining the user on the application user list.

To assign roles to users using the Quick Base API or UI, you must have either Basic Access with Sharing access or Full Administration access to the application. Note that, if you have Basic Access with Sharing permissions, you cannot add a user to a role that has Full Administration permissions.

top

Request parameters

ParameterValueRequired?

userid

The user ID. You can use API_GetUserInfo to get the user ID for a particular user.

yes

roleid

The user’s current role in the application

yes

newroleid

If this parameter is not supplied, or is supplied but left blank, the role id is set to 9 (None). If this parameter is supplied with an invalid role id (including 0), the API call will return an error.

Note: If you change one user role to 9, and the user has another role in this app, the other role is still active. The user will still have the access given by that other role.

no

ticket

a ticket - needed for application access.

yes, one of:

  • ticket
  • username/password
  • user token

usertoken

The user token is an alternative means of authentication, used for API access. User tokens cannot be used to access the Quick Base UI.

yes, one of:

  • ticket
  • username/password
  • user token

apptoken

Supply a valid application token.

yes, if app tokens are being used by this application.

udata

A string value that you want returned. It will not be handled by Quick Base but it will be returned in the response. One possible use is to maintain state in the calling application.

no

top

Response values

Element NameValue

action

Echoes the originating request, for example, API_AddField.

errcode

If successful, this will be 0. If there is a failure, there will be a code returned here. See Appendix A for a list of codes.

errtext

If successful, this will be “No error”. If there is a failure this contains more detail on the nature of the failure.

udata

Optional. Contains any udata value supplied in the request.

top

Sample XML Request

POST https://target_domain/db/target_dbid HTTP/1.0
Content-Type: application/xml
Content-Length:
QUICKBASE-ACTION: API_ChangeUserRole

<qdbapi>
   <ticket>auth_ticket</ticket>
   <apptoken>app_token</apptoken>
   <userid>112248.5nzg</userid>
   <roleid>11</roleid>
   <newRoleid/>
</qdbapi>

top

URL alternative

https://target_domain/db/target_dbid?a=API_ChangeUserRole
&ticket=auth_ticket&apptoken=app_token&userid=112245.efy7
&roleid=10&newRoleID=11

where target_domain is the domain against which you are invoking this call, for example, quickbase.com. Read about this notation.

top

Sample response

<?xml version="1.0" ?>
<qdbapi>
   <action>api_changeuserrole</action>
   <errcode>0</errcode>
   <errtext>No error</errtext>
</qdbapi>

 

Go back    |     |  

© 1999-2018 QuickBase, Inc. All rights reserved. Legal Notices.