-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAPI planning.txt
More file actions
63 lines (46 loc) · 1.41 KB
/
API planning.txt
File metadata and controls
63 lines (46 loc) · 1.41 KB
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
Standar API
{root.api}/{version}/{grouping}/{endpoint}
SAMPLE:
http://mern-api.happycoding.com/v1/auth/Login
Standar Status Response
200 - OK ---> Call API Success
201 - CREATED ---> POST Success
400 - BAD REQUEST ---> Error on Client Side (Bisa input yang salah dll).
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
GROUP: Authentication
[1] - Register
{root.api}/{version}/auth/Register
[2] - Login
{root.api}/{version}/auth/Login
req:
{
"title": "title",
"image": "imageFile.png",
"body": "Lorem Ipsum is simply dummy text of the printing"
}
res:
{
"message": "Create Blog Post Success",
"data": {
"post_id": 1,
"title": "Title Blog",
"image": "imageFile.png"
"body": "Lorem Ipsum is simply dummy text of the printing",
"create_at": "01/12/2022",
"author": {
"uid": 1,
"name": "Testing"
}
}
}
err-response:
400 - input yang anda masukan tidak valid
GROUP: BLOG
[1] - Create Blog Post
[2] - Get Blog Post
[3] - Update Blog Post
[4] - Delete Blog Post