User Management
Login as an administrative user before using any of these API calls.
add
Add a new user
Parameter | Notes |
---|---|
c | admin
|
t | users
|
oper | add
|
name | Name of the user. This is used as the login id |
dname | Display name of the user |
pass | Password for the user |
rights |
User access rights. To create an administrative user, use 65535. For other users logically OR one or more of the following.
|
status | The status of the user, 0 for in-active and 1 for active. |
acslevel | The access level for the user. This is a number between 0 and 32. The user can view data columns with an equal or less access level. You can assign an access level to any of the domain data columns to restrict access to that column. By default all data columns have an access level of zero. All administrative users have an access level of 24, so it is possible to block some data columns from displaying altogether by assigning an access level of 25 or above. You can always change the access level to re-enable the columns. |
cids | Comma separated category ids the user has access to. |
list | Optional. Set it to yes to get information on all existing users (after the user has been added)
|
/api.php?c=admin&t=users&oper=add&name=daneel&dname=Daneel%20Olivaw&pass=mysecret92&rights=15&status=1&acslevel=0&cids=2,3,6,7&list=yes
{ "status": "ok", "error": "", "validate": 0, "users": [ { "id": "3", "name": "elijah", "dname": "Elijah Baley", "admin": true }, { "id": "1", "name": "softnik", "dname": "Softnik", "admin": false }, { "id": "6", "name": "daneel", "dname": "Daneel Olivaw", "admin": false } ] }
edit
Parameter | Notes |
---|---|
c | admin
|
t | users
|
oper | edit
|
name | username
|
One or more of user column names (rights, acslevel, dname, cids, status etc) | Corresponding column values |
The following will changes the access rights and allowed category ids for use daneel
/api.php?c=admin&t=users&oper=edit&name=daneel&rights=15&&cids=2,3,6,7,10
Include only the options you want to change. For example, include the pass
option only if you wish to change the password.
Please see the add
option for details about the parameters.
list
Get the user list
Parameter | Notes |
---|---|
c | admin
|
t | users
|
oper | list
|
?c=admin&t=users&oper=list
{ "status": "ok", "error": "", "validate": 0, "users": [ { "id": "3", "name": "elijah", "admin": true }, { "id": "2", "name": "daneel", "admin": false }, { "id": "1", "name": "softnik", "admin": false } ] }
del
Parameter | Notes |
---|---|
c | admin
|
t | users
|
oper | del
|
name | Name of the user to delete
|
list | Optional. Set it to yes to get information on all existing users (after deletion)
|
?c=admin&t=users&oper=del&name=daneel
{ "status": "ok", "error": "", "validate": 0 }
or
{ "status": "notok", "error": "User daneel not found", "validate": 0 }
Delete the user and return information on all the current users.
?c=admin&t=users&oper=del&name=daneel&list=yes
{ "status": "ok", "error": "", "validate": 0, "users": [ { "id": "3", "name": "elijah", "dname": "Elijah Baley", "admin": true }, { "id": "1", "name": "softnik", "dname": "Softnik", "admin": false } ] }
get
?c=admin&t=users&oper=get&name=daneel
{ "status": "ok", "error": "", "validate": 0, "data": { "id": "2", "name": "daneel", "added_on": "2019-02-06 09:00:37", "last_sign_in_stamp": "2019-02-06 09:16:41", "active": "1", "rights": "63", "acslevel": "1", "admin": false, "cids": [ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ], "dname": "Daneel Olivaw" } }