User management
TBMQ is initialized with a default admin user ([email protected] / sysadmin). In production, create a
dedicated admin user and either remove the default account or change its password.
All examples below use curl. Replace localhost:8083 with your server address if TBMQ is running remotely.
Authentication
Section titled “Authentication”Obtain an access token by logging in:
curl --location --request POST 'http://localhost:8083/api/auth/login' \--header 'Content-Type: application/json' \--data-raw '{ "username":"[email protected]", "password":"sysadmin"}'The response contains a token field. Export it for use in subsequent requests:
export ACCESS_TOKEN=PLACE_YOUR_TOKEN_HEREGet all users
Section titled “Get all users”curl --location --request GET "http://localhost:8083/api/admin?pageSize=50&page=0" \--header "X-Authorization: Bearer $ACCESS_TOKEN"Each user entity has a unique id that can be used to update or delete that user.
Create or update a user
Section titled “Create or update a user”curl --location --request POST 'http://localhost:8083/api/admin' \--header "X-Authorization: Bearer $ACCESS_TOKEN" \--header 'Content-Type: application/json' \--data-raw '{ "id":$USER_ID, "email":"[email protected]", "password":"test", "firstName":"test", "lastName":"test", "roleName": "ADMIN"}'If $USER_ID is null or the id field is absent, a new user is created. Otherwise, the user with the given ID
is updated.
Delete a user
Section titled “Delete a user”curl --location --request DELETE 'http://localhost:8083/api/admin/$USER_ID' \--header "X-Authorization: Bearer $ACCESS_TOKEN"Replace $USER_ID with the actual ID of the user you want to delete.