Webservices » History » Version 3
Sachin Divekar, 02/11/2023 11:00 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 | 3 | Sachin Divekar | `GET /user` |
67 | 2 | Sachin Divekar | |
68 | **URL Parameters:** |
||
69 | 1 | Sachin Divekar | |
70 | 3 | Sachin Divekar | - `id` (string): The unique ID of the user. |
71 | - `name` (string): User name |
||
72 | |||
73 | One of id or name must be present. |
||
74 | 2 | Sachin Divekar | |
75 | No request body required. |
||
76 | |||
77 | ## Response |
||
78 | |||
79 | **Body**: |
||
80 | |||
81 | ```json |
||
82 | { |
||
83 | "id": "df84nsd...", |
||
84 | "username": "rahuld", |
||
85 | "email": "rahul@example.com", |
||
86 | "firstName": "Rahul", |
||
87 | "lastName": "Deshpande", |
||
88 | "emailVerified": true, |
||
89 | "enabled": true, |
||
90 | "attributes": { |
||
91 | "vendor": true |
||
92 | } |
||
93 | } |
||
94 | |||
95 | ``` |
||
96 | - `id`: string, required. The unique ID of the user. |
||
97 | - `username`: string, required. The username for the user. |
||
98 | - `email`: string, optional. The user's email address. |
||
99 | - `firstName`: string, optional. The user's first name. |
||
100 | - `lastName`: string, optional. The user's last name. |
||
101 | - `emailVerified`: boolean, optional. A flag indicating whether the user's email address has been verified. |
||
102 | - `enabled`: boolean, required. A flag indicating whether the user account is enabled. |
||
103 | - `attributes`: object, optional. A map of additional attributes for the user. |
||
104 | |||
105 | ## Errors |
||
106 | - **USER_NOT_FOUND**: The specified user does not exist in the realm. |