-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAPI-SPEC.txt
77 lines (64 loc) · 1.46 KB
/
API-SPEC.txt
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
STANDARD API
{root.api}/{version.api}/{grouping}/{endpoint}
SAMPLE:
http://farmgenius-api.capstoneproject.com/v1/auth/login
STANDARD STATUS RESPONSE:
200 -> OK => Call API Success
201 -> CREATED => Post Success
400 -> BAD REQUEST => Error on client side (input missing, etc..)
401 -> UNAUTHORIZED => User not authorized to the request
403 -> FORBIDDEN => User not allowed to access
404 -> NOT FOUND => Request endpoint not found
500 -> INTERNAL SERVER ERROR => Error on server side
502 -> BAD GATEWAY => Invalid Response from another request
ETC..
GROUP: Authentication
[1] - Register
{root.api}/{version.api}/auth/register
req:
{
"name" : "Testing API,
"email : "testingapi@gmail.com,
"password" : "Testing123"
}
res:
{
"message" : "Register Success",
"data": {
"id" : "nanoid(16)"
"name" : "Testing API",
"email": "testingapi@gmail.com"
}
}
err-response :
400 -> Input yang dimasukkan tidak valid
[2] - Login
{root.api}/{version.api}/auth/login
req:
{
"email : "testingapi@gmail.com,
"password" : "Testing123"
}
{
"message" : "Login Success",
}
GROUP: DISEASE
[1] CREATE DISEASE
req: {
"name" : "Disease Name",
"desc" : "Description of the disease"
"solution" : "Solution of disease"
}
res:
{
"message" : "Data penyakit berhasil ditambahkan,
"data" : {
code : 200,
status: "OK",
data: data
}
}
[2] GET DISEASE
[3] UPDATE DISEASE
[4] DELETE DISEASE
---UPDATE SOON---