Webservices » History » Revision 4
Revision 3 (Sachin Divekar, 02/11/2023 11:00 PM) → Revision 4/5 (Sachin Divekar, 21/11/2023 04:14 PM)
>{{toc}} # user_create Creates a new user. ## Request **Endpoint** ``` POST /users ``` **Body:** ```json { "realm": "vendors", "username": "rahuld", "email": "rahul@example.com", "firstName": "Rahul", "lastName": "Deshpande", "enabled": true } ``` - `realm` (string): Name of the realm for new user creation. - `username`: string, required. Username for the user. - `email`: string, required. User's email address. - `firstName`: string, optional. User's first name. - `lastName`: string, optional. User's last name. - `enabled`: boolean, required. Indicates if user account is enabled. ## Response ```json { "id": "df84nsd....", "username": "rahuld", "email": "rahul@example.com", "firstName": "Rahul", "lastName": "Deshpande", "enabled": true } ``` - `id`: string, required. Unique user ID. - `username`: string, required. Username for the user. - `email`: string, optional. User's email address. - `firstName`: string, optional. User's first name. - `lastName`: string, optional. User's last name. - `enabled`: boolean, required. Indicates if user account is enabled. ## Errors - `REALM_NOT_FOUND`: Specified realm does not exist. - `USERNAME_EXISTS`: User with provided username already exists in the realm. # `user_get` The `user_get` call retrieves the details of a specific user in a specific realm. It returns the complete user definition in JSON format. ## Request **Endpoint:** `GET /user` **URL Parameters:** - `id` (string): The unique ID of the user. - `name` (string): User name - `realm` (string): Realm to use for retrieving the user. This is a mandatory parameter. `realm` is mandatory. One of id or name must be present. No request body required. ## Response **Body**: ```json { "id": "df84nsd...", "username": "rahuld", "email": "rahul@example.com", "firstName": "Rahul", "lastName": "Deshpande", "emailVerified": true, "enabled": true, "attributes": { "vendor": true } } ``` - `id`: string, required. The unique ID of the user. - `username`: string, required. The username for the user. - `email`: string, optional. The user's email address. - `firstName`: string, optional. The user's first name. - `lastName`: string, optional. The user's last name. - `emailVerified`: boolean, optional. A flag indicating whether the user's email address has been verified. - `enabled`: boolean, required. A flag indicating whether the user account is enabled. - `attributes`: object, optional. A map of additional attributes for the user. ## Errors - **USER_NOT_FOUND**: The specified user does not exist in the realm.