forked from alaress/schoolbox-api-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser.yaml
119 lines (117 loc) · 3.59 KB
/
user.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
get:
operationId: userSearch
tags: [user]
summary: Get a list of users
description: |
This allows you to search for users and get details about the user. The search filter attributes are all optional.
The number of users returned is 5 by default, if the limit query parameter is not provided.
This endpoint is only available to superusers to avoid leaking information about users to other users.
responses:
'200':
$ref: ../components/responses/user-list.yaml
default:
$ref: ../components/responses/problem.yaml
parameters:
- name: search
in: query
description: |
Will search `username`, `firstname`, `lastname` and `preferred_name` for non exact matches.
schema:
type: string
- name: filter
in: query
description: |
Json encoded object of fields and values to filter users on. \
For example, to get user with username `jcoles`: \
`filter=%7b%22username%22%3a%22jcoles%22%7d`
schema:
type: object
properties:
externalId:
type: string
example: 501
username:
type: string
example: jreed
email:
type: string
example: [email protected]
year:
description: A Year level to filter users with.
oneOf:
- type: object
properties:
id:
type: integer
description: The DB identifier of the Year Level.
example: 6
- type: object
properties:
name:
type: string
description: The name of the Year Level, may not be unique.
example: Year 6
role:
description: A role to filter users with.
oneOf:
- type: object
properties:
id:
type: integer
description: The DB identifier of the Role.
example: 1
- type: object
properties:
name:
type: string
description: The name of the Role, may not be unique.
example: Staff
roleType:
type: string
enum:
- student
- staff
- parent
- guest
campus:
description: A campus to filter users with.
oneOf:
- type: object
properties:
id:
type: integer
description: The DB identifier of the Campus.
example: 6
- type: object
properties:
name:
type: string
description: The name of the Campus, may not be unique.
example: Senior
- $ref: ../components/parameters/cursor.yaml
- $ref: ../components/parameters/limit.yaml
post:
operationId: userPost
tags: [user]
summary: Create a user
description: |
This can be used to create a new user in the system. This can only be completed by a superuser.
The minimum fields required to create a user are:
```
"username": "rwhite",
"role": {
"id": 4
},
"campus": [
{
"id": 1
}
],
"firstName": "Rebecca"
}
```
responses:
'201':
$ref: ../components/responses/user-item.yaml
requestBody:
$ref: ../components/requestBodies/user-item.yaml