-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.apib
179 lines (119 loc) · 3.28 KB
/
api.apib
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
FORMAT: 1A
# Group Accounts
## Accounts Collection [/accounts]
### Create Account [POST]
+ Request (applications/json, multipart/form-data)
+ Attributes
+ email (string)
+ username (string)
+ password (string)
+ Response 201 (applications/json)
+ Headers
Location: /accounts/<uuid:id>
+ Body
{
"id": "a65efed8-6ced-4666-b1e8-f2247b8abbfc"
}
## Account Details [/accounts/<uuid:id>]
### Get account [GET]
+ Request
+ Headers
Authorization: <auth_token>
+ Response 200 (applications/json)
+ Body
{
"id": "a65efed8-6ced-4666-b1e8-f2247b8abbfc",
"email": "[email protected]",
"username": "user1"
}
### Update account [PUT]
+ Request (applications/json, multipart/form-data)
+ Headers
Authorization: <auth_token>
+ Attributes
+ email (string, optional)
+ username (string, optional)
+ Response 200 (applications/json)
+ Headers
Location: /accounts/<uuid:id>
+ Body
null
## Account password [/accounts/<uuid:id>/password]
### Change password [PUT]
+ Request
+ Headers
Authorization: <auth_token>
+ Attributes
+ current_password (string)
+ confirmed_password (string)
+ Response 200 (applications/json)
+ Body
null
+ Response 400 (applications/json)
+ Body
{
"message": null,
"errors": {
"current_password": "Current password is not correct"
}
}
{
"message": null,
"errors": {
"confirmed_password": "Password does not match"
}
}
## Password Reset [/accounts/password]
### Find account via email [POST]
+ Request (applications/json, multipart/form-data)
+ Attributes
+ email (string)
+ Response 202
+ Response 404 (applications/json)
+ Body
{
"message": "Account not found",
"errors": null
}
### Reset password [GET]
+ Request
+ Parameters
+ token (string)
+ Response 200 (application/json)
## Account Activation Token [/accounts/activation]
Check if a user uses valid email or not.
If user is not currently logined, email is required.
### Get activation token [POST]
+ Request (applications/json, multipart/form-data)
+ Headers
Authorization: <auth_token> (optional)
+ Attributes
+ email (string, optional)
+ Response 202
### Activate account [GET]
+ Request
+ Parameters
+ token (string)
+ Response 200 (applications/json)
+ Headers
Location: /accounts/<uuid:id>
+ Body
null
# Group Authentication
## Authenticate [/auth]
### Login [POST]
+ Request (applications/json, multipart/form-data)
+ Attributes
+ email_or_username (string)
+ password (string)
+ Response 200 (application/json)
+ Body
{
"token": "some kind of jwt"
}
+ Response 400 (applications/json)
+ Body
{
"message": "Authentication failed. Please try again",
"errors": null
}