Admins can list, create and delete users from the system.
A list of matching user may be queried by the system. The optional query parameters are as follows:
| Name | Value Description |
|---|---|
| text | text to search for in the username, first name and/or last name |
| reverse | true to get the oldest users first; false (default) to get newest first |
| offset | offset into list of users for paging |
| limit | limit to show for paging. The maximum number of users to display is 1000. |
To query for users, add query parameters after the sensors URL as follows:
| URL | https://smartstreets.sensetecnic.com/wotkit/api/users?{query} |
| Privacy | Admin |
| Format | json |
| Method | GET |
| Returns | On error, an appropriate HTTP status code; On success, OK 200 and a list of users matching the query. |
To view a single user, query by username or id as follows:
| URL | https://smartstreets.sensetecnic.com/wotkit/api/users/{username} |
| Privacy | Admin |
| Format | json |
| Method | GET |
| Returns | Appropriate HTTP status code; OK 200 - if successful |
example
curl --user {id}:{password}
"https://smartstreets.sensetecnic.com/wotkit/api/users/1"
Output:
{
'id': 1,
'username': 'sensetecnic',
'email': 'info@sensetecnic.com',
'firstname': 'Sense',
'lastname': 'Tecnic',
'enabled': True,
'accountNonExpired': True,
'accountNonLocked': True,
'credentialsNonExpired': True
}
To register a user, you POST a user resource to the url /users.
To create a user:
| URL | https://smartstreets.sensetecnic.com/wotkit/api/users |
| Privacy | Admin |
| Format | json |
| Method | POST |
| Returns | HTTP status code; Created 201 if successful; Bad Request 400 if user is invalid; Conflict 409 if user with the same username already exists |
To update a user:
| URL | https://smartstreets.sensetecnic.com/wotkit/api/users/{username} |
| Privacy | Admin |
| Format | json |
| Method | PUT |
| Returns | HTTP status code; No Content 204 if successful |
Deleting a user is done by deleting the user resource.
To delete a user:
| URL | https://smartstreets.sensetecnic.com/wotkit/api/users/{username} |
| Privacy | Admin |
| Format | not applicable |
| Method | DELETE |
| Returns | HTTP status code; No Response 204 if successful |