-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAPI_DOC.apib
259 lines (179 loc) · 6.14 KB
/
API_DOC.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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
FORMAT: 1A
# VUTTR API
HOST: localhost:3001
::: note
#### <i class="fa fa-info"></i> Info
Note que todas as rotas exceto Users[Login e Cadastro], é obrigatório o envio:
+ Headers
Authorization:"token"
Token é recebido pela rota de login
:::
# Group Users
## Login [/user/logar]
### Login [POST]
+ Request (application/json)
+ Attributes
+ login:jarn40(string,required) - Login do usuario
+ password:123(string,required) - Senha do usuario
+ Response 202 (application/json)
{"token": "token"}
## Cadastro [/user/cadastrar]
### Cadastrar [POST]
+ Request (application/json)
+ Attributes
+ firstName:Alfredo(string,required) - Primeiro Nome do usuario
+ lastName:Neto(string,required) - Ultimo Nome do usuario
+ login:jarn40(string,required) - Login do usuario
+ password:123(string,required) - Senha do usuario
+ avatar:https://avatars1.githubusercontent.com/u/20113585?s=460&v=4(string,optional) - Link opcional de imagem hospedada em nuvem
+ Response 201 (application/json)
{
"firstName": "Alfredo",
"lastName": "Neto",
"login": "jarn40",
"password": "123",
"avatar": "https://avatars1.githubusercontent.com/u/20113585?s=460&v=4"
}
+ Response 400 (text/html)
Error Message
+ Response 403 (text/html)
Usuário jarn40 já existe.
## Manipulaçao [/user/{id}]
+ Parameters
+ id:5e56a7c91575415d407ee4b6(string,required) - Id da ferramenta
### Buscar [GET]
+ Request
+ Headers
Authorization : "Token"
+ Response 200 (application/json)
{
"_id": "5e56a7c91575415d407ee4b6",
"firstName": "Alfredo",
"lastName": "Neto",
"avatar": "",
"login": "root",
"password": "$2b$07$c5o5PkJ9ODndyDxw6Px03O/KzeQ15WpKCxQGFaIP96QmW7O37QYZe",
"createdAt": "2020-02-26T17:15:53.689Z",
"updatedAt": "2020-02-26T17:15:53.689Z",
"__v": 0
}
+ Response 401 (text/html)
Unauthorized
### Deletar [DELETE]
+ Request
+ Headers
Authorization : "Token"
+ Response 200 (application/json)
{
"Documento 5e56a7c91575415d407ee4b6 removido!"
}
+ Response 400 (text/html)
Error Message
+ Response 401 (text/html)
Unauthorized
# Group Tools
## Ferramentas [/tools{?global,tag}]
+ Parameters
+ global(string, optional) - string para filtrar busca no banco pelos campos ( title, description, tags ), caso um dos campos contenha a string
+ tag(string, optional) - string para filtra busca no banco pelo campo de tags, precisa ser match exato.
### Listar [GET]
::: note
#### <i class="fa fa-info"></i> Info
Caso nenhum parametro seja enviado, a busca retornará sem filtros.
:::
+ Request
+ Headers
Authorization: "Token"
+ Response 200 (application/json)
[
{
"tags": [
"css",
"tricks",
"efficiency"
],
"_id": "5e582b4cb49c105e8c105a0b",
"title": "CssTricks",
"link": "https://css-tricks.com/",
"description": "tricks to use Css ",
"__v": 0
},
{
"tags": [
"tv",
"globo",
"bbb",
"series"
],
"_id": "5e589ab5022ab42830825ac8",
"title": "GloboPlay",
"link": "https://globoplay.globo.com/",
"description": "TV 24Hrs",
"__v": 0
}
...
]
+ Response 401 (text/html)
Unauthorized
### Adicionar [POST]
:::warning
#### <i class="fa fa-warning"></i> Cuidado
Com o método POST os parametros opicionais não devem ser enviados!!
:::
+ Request (application/json)
+ Attributes
+ title:Hotel(string,required) - Titulo da Ferramenta
+ link:https://github.com/typicode/hotel(string,required) - HTTP link da Ferramenta
+ description:Local app manager. Start apps within your browser, developer tool with local .localhost domain and https out of the box.(string,required) - Breve Descrição da ferramenta
+ tags:node,organizing,webapps,domain,developer(array[string], required) - Lista de tags relacionadas a ferramenta
+ avatar:https://avatars1.githubusercontent.com/u/20113585?s=460&v=4(string,optional) - Link da imagem hospedada em cloud
+ Headers
Authorization: "Token"
+ Response 200 (application/json)
{
"tags": [
"node",
"organizing",
"webapps",
"domain",
"developer",
"https",
"proxy"
],
"_id": "5e597c5e1a0af90a94e68582",
"title": "Figura",
"link": "https://github.com/typicode/hotel",
"avatar":"https://avatars1.githubusercontent.com/u/20113585?s=460&v=4",
"description": "Local app manager. Start apps within your browser, developer tool with local .localhost domain and https out of the box.",
"__v": 0
}
+ Response 201 (application/json)
{
"tags": [
"node",
"organizing",
"webapps",
"domain",
"developer",
"https",
"proxy"
],
"_id": "5e597c5e1a0af90a94e68582",
"title": "Figura",
"link": "https://github.com/typicode/hotel",
"avatar":"https://avatars1.githubusercontent.com/u/20113585?s=460&v=4",
"description": "Local app manager. Start apps within your browser, developer tool with local .localhost domain and https out of the box.",
"__v": 0
}
+ Response 401
Unauthorized
## Ferramentas [/tools/{id}]
+ Parameters
+ id:5e597c5e1a0af90a94e68582(string,required) - Id da ferramenta a ser removida
### Remover [DELETE]
+ Request
+ Headers
Authorization: "Token"
+ Response 204
+ Response 401
Unauthorized