-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapiary.apib
94 lines (57 loc) · 2.07 KB
/
apiary.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
FORMAT: 1A
HOST: http://localhost:3000
# Node API Base
API boilerplate project for NodeJS with Typescript
## Server [/status]
### Server status [GET]
Check if the server is online
+ Response 200 (application/json)
+ Body
{
"online": true
}
## User Collection [/user]
### Create User [POST]
Create a new user in the app to authenticate afterwards
+ Request (application/json)
{
"email": "[email protected]",
"password": "shhhh"
}
+ Response 200 (application/json)
+ Headers
token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjNmMGU2N2NlLWFlOWItNDIwOC1hOGI0LWY1NGIyNmE0OWQxZiIsInJvbGUiOiJSZWd1bGFyIiwiaWF0IjoxNTM3MzEyMDExfQ.fMrmKpkUpc3mf-Ol7j-kwL99mX74L27oP7FZApTGxSU
+ Body
{
"id": "3f0e67ce-ae9b-4208-a8b4-f54b26a49d1f",
"email": "[email protected]"
}
## Admin Collection [/admin]
### Create Admin [POST]
Create a new admin in the app to manage the app. An admin
can only be created by other admin (authentication and authorization
required for this operation)
+ Request (application/json)
{
"email": "[email protected]",
"password": "shhhh"
}
+ Response 200 (application/json)
+ Headers
token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjNmMGU2N2NlLWFlOWItNDIwOC1hOGI0LWY1NGIyNmE0OWQxZiIsInJvbGUiOiJSZWd1bGFyIiwiaWF0IjoxNTM3MzEyMDExfQ.fMrmKpkUpc3mf-Ol7j-kwL99mX74L27oP7FZApTGxSU
+ Body
{
"id": "3f0e67ce-ae9b-4208-a8b4-f54b26a49d1f",
"email": "[email protected]"
}
## Authorization [/auth]
### Login [POST]
Authenticate in the app
+ Request (application/json)
{
"email": "[email protected]",
"password": "shhhh"
}
+ Response 204 (application/json)
+ Headers
token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjNmMGU2N2NlLWFlOWItNDIwOC1hOGI0LWY1NGIyNmE0OWQxZiIsInJvbGUiOiJSZWd1bGFyIiwiaWF0IjoxNTM3MzEyMDExfQ.fMrmKpkUpc3mf-Ol7j-kwL99mX74L27oP7FZApTGxSU