-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi-planning.txt
More file actions
90 lines (72 loc) · 2.13 KB
/
api-planning.txt
File metadata and controls
90 lines (72 loc) · 2.13 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
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
[MONGODB]
password database user: EIy3FPOao8lK7syG
conncetion string: mongodb+srv://yusuf:<password>@cluster0.bwnm0.mongodb.net/<dbname>?retryWrites=true&w=majority
[Standar API]
{root.api}/{version}/{grouping}/{endpoint}
SAMPLE:
http://vysf.api.yusufism.com/v1/auth/login
[Standar Status Response]
200 - OK --> Call API Success
201 - CREATED --> Post Success
400 - BAD REQUEST --> Error on Client Side
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 GATEAWAY --> Invalid Response From Another Request
==========================================================================================
GROUP: BLOG
[1] - Create Blog Post
[POST] : {root.api}/version/blog/post
req:
{
"title": "Title Blog",
"image": "imagefile.png",
"body": "Lorem bla..bla.."
}
res:
{
"message": "Create Blog Post Success",
"data": {
"post_id": 1,
"title": "Title Blog",
"image": "imagefile.png",
"body": "Lorem bla..bla..",
"created_at": "12/06/2020",
"author": {
"uid": 1,
"name": "Testing"
}
}
}
err-response:
201 -> Blog Post Berhasil Dibuat
400 -> Input yang anda masukan tidak valid
==========================================================================================
GROUP: BLOG
[2] - Get Blog Post
req:
{
"title": "Title Blog",
"image": "imagefile.png",
"body": "Lorem bla..bla.."
}
res:
{
"message": "Create Blog Post Success",
"data": {
"post_id": 1,
"title": "Title Blog",
"image": "imagefile.png",
"body": "Lorem bla..bla..",
"created_at": "12/06/2020",
"author": {
"uid": 1,
"name": "Testing"
}
}
}
err-response:
201 -> Blog Post Berhasil Dibuat
400 -> Input yang anda masukan tidak valid
==========================================================================================