Project

General

Profile

Webservices » History » Version 2

Sachin Divekar, 02/11/2023 05:17 PM

1 2 Sachin Divekar
>{{toc}}
2 1 Sachin Divekar
3
# user_create
4
5
Creates a new user.
6
7
## Request
8
9
**Endpoint**
10
11
```
12
POST /users
13
```
14
15 2 Sachin Divekar
**Body:**
16 1 Sachin Divekar
17
```json
18
{
19 2 Sachin Divekar
  "realm": "vendors",
20 1 Sachin Divekar
  "username": "rahuld",
21
  "email": "rahul@example.com",
22
  "firstName": "Rahul",
23
  "lastName": "Deshpande",
24
  "enabled": true
25
}
26
```
27 2 Sachin Divekar
- `realm` (string): Name of the realm for new user creation.
28 1 Sachin Divekar
- `username`: string, required. Username for the user.
29
- `email`: string, required. User's email address.
30
- `firstName`: string, optional. User's first name.
31
- `lastName`: string, optional. User's last name.
32
- `enabled`: boolean, required. Indicates if user account is enabled.
33
34
## Response
35
36
```json
37
{
38
  "id": "df84nsd....",
39
  "username": "rahuld",
40
  "email": "rahul@example.com",
41
  "firstName": "Rahul",
42
  "lastName": "Deshpande",
43
  "enabled": true
44
}
45
```
46
47
- `id`: string, required. Unique user ID.
48
- `username`: string, required. Username for the user.
49
- `email`: string, optional. User's email address.
50
- `firstName`: string, optional. User's first name.
51
- `lastName`: string, optional. User's last name.
52
- `enabled`: boolean, required. Indicates if user account is enabled.
53
54 2 Sachin Divekar
## Errors
55 1 Sachin Divekar
- `REALM_NOT_FOUND`: Specified realm does not exist.
56
- `USERNAME_EXISTS`: User with provided username already exists in the realm.
57 2 Sachin Divekar
58
# `user_get` 
59
60
The `user_get` call retrieves the details of a specific user in a specific realm. It returns the complete user definition in JSON format.
61
62
## Request
63
64
**Endpoint:**
65
66
`GET /user/{username}`
67
68
**URL Parameters:**
69
70
- `userId` (string): The unique ID of the user.
71
72
No request body required.
73
74
## Response
75
76
**Body**:
77
78
```json
79
{
80
  "id": "df84nsd...",
81
  "username": "rahuld",
82
  "email": "rahul@example.com",
83
  "firstName": "Rahul",
84
  "lastName": "Deshpande",
85
  "emailVerified": true,
86
  "enabled": true,
87
  "attributes": {
88
    "vendor": true
89
  }
90
}
91
92
```
93
- `id`: string, required. The unique ID of the user.
94
- `username`: string, required. The username for the user.
95
- `email`: string, optional. The user's email address.
96
- `firstName`: string, optional. The user's first name.
97
- `lastName`: string, optional. The user's last name.
98
- `emailVerified`: boolean, optional. A flag indicating whether the user's email address has been verified.
99
- `enabled`: boolean, required. A flag indicating whether the user account is enabled.
100
- `attributes`: object, optional. A map of additional attributes for the user.
101
102
## Errors 
103
- **USER_NOT_FOUND**: The specified user does not exist in the realm.