User API

A read-only user is created with the /settings/readOnlyUser URI endpont. Only one read-only user can be created.

Description

Table 1. User endpoints
HTTP method URI path Description Parameters
POST /settings/readOnlyUser Creates the read-only user username, password, just_validate
PUT /settings/readOnlyUser Changes the read-only user password password
DELETE /settings/readOnlyUser Deletes the user none
GET /settings/readOnlyAdminName Retrieves the read-only username none
Table 2. User return codes
Returns Errors Error description
success: 200 [] error: 400 {“errors”:{field_name:error_message}}
success: 200 [] error: 400 {“errors”:{field_name:error_message}}
success: 200 [] error: 400 {“errors”:{field_name:error_message}}
success: 200 “username” not found: 404  

Creating a read-only user

To create a read-only user, specify the username and password.

Note: Administrative access is required to create a read-only user.
POST /settings/readOnlyUser 
	-d username=[a_name] 
	-d password=[a_password] 

Curl request syntax:

curl -X POST -u [admin]:[password] http://[localhost]:8091/settings/readOnlyUser -d username=[a_name] -d password=[a_password] 

The endpoint has one additional, optional parameter just_validate=1. If this parameter is specified, the server does not create the user instead the username and password for the read-only user is validated.

Note: A username is a UTF–8 string that does not contain spaces, control characters or any of these characters: ()<>@,;:\"/[]?={} characters. Any password must be UTF–8 with no control characters and must be at least six characters long.

Changing the password

To change the password for a read-only user, specify the user name and the new password:

PUT /settings/readOnlyUser
	-d username=[a_name] 
	-d password=[new_password] 

Curl request syntax:

curl -X PUT -u [admin]:[password] http://[localhost]:8091/settings/readOnlyUser -d username=[a_name] -d password=[new_password] 

Deleting the read-only user

To delete the user, specify the URI:

DELETE /settings/readOnlyUser

Curl request syntax:

curl -X DELETE -u [admin]:[password] http://[localhost]:8091/settings/readOnlyUser 

Getting the administrator name

To retrieve the read-only username, administrative or read-only permissions are required:

GET /settings/readOnlyAdminName

Curl request syntax:

curl -u [admin]:[password] http://[localhost]:8091/settings/readOnlyAdminName

A response is returned with the read-only username as payload, success: 200 | "username". If there is no read-only user, the following error not found: 404 is returned.