-
Notifications
You must be signed in to change notification settings - Fork 0
/
API.http
140 lines (106 loc) · 3.33 KB
/
API.http
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
GET http://localhost:8000/api/test HTTP/1.1
###
POST http://localhost:8000/api/signup HTTP/1.1
Content-Type: 'application/json'
{
"username": "sabayblc",
"fullname": "Sabyblc",
"email": "[email protected]",
"password": "sabayblc"
}
###
GET http://localhost:8000/api/users HTTP/1.1
### get verify code
POST http://localhost:8000/api/get_verify_code HTTP/1.1
Content-Type: 'application/json'
{
"email": "[email protected]"
}
### check verify code
POST http://localhost:8000/api/check_verify_code HTTP/1.1
Content-Type: 'application/json'
{
"email": "[email protected]",
"confirmation_code": "161493367216041eea89c01c"
}
### login account and store token
POST http://localhost:8000/api/login HTTP/1.1
Content-Type: 'application/json'
{
"email": "[email protected]",
"password": "sabayblc"
}
### change_info_after signup
POST http://localhost:8000/api/signup-info-after-signup HTTP/1.1
Authorization: Bearer 1|Y75na4O3u1KLZmuqzIwq02EfxxYlzohZredR3xTL
Content-Disposition: form-data; name="image"; filename="/home/linux/Pictures/Bai2.png"
Content-Type: image/png
### get user info by token
POST http://localhost:8000/api/token HTTP/1.1
Content-Type: 'application/json'
Accept: application/json
Authorization: Bearer 1|Y75na4O3u1KLZmuqzIwq02EfxxYlzohZredR3xTL
### get test auth token
POST http://localhost:8000/api/get HTTP/1.1
Accept: application/json
Authorization: Bearer 1|Y75na4O3u1KLZmuqzIwq02EfxxYlzohZredR3xTL
### change new password
POST http://localhost:8000/api/change-password HTTP/1.1
Accept: application/json
Authorization: Bearer 1|Y75na4O3u1KLZmuqzIwq02EfxxYlzohZredR3xTL
Content-Type: 'application/json'
{
"password": "sabayblc",
"new_password": "sabayblc1"
}
### forgot password / request confirmation code
POST http://localhost:8000/api/forgot-password HTTP/1.1
Content-Type: 'application/json'
{
"email": "[email protected]"
}
### change forgot password by confirmation code
POST http://localhost:8000/api/reset-password HTTP/1.1
Content-Type: 'application/json'
{
"confirmation_code": "161493802616041ffaa454e1",
"password": "sabayblc"
}
### get all courses
POST http://localhost:8000/api/get-all-courses HTTP/1.1
Accept: application/json
Authorization: Bearer 1|Y75na4O3u1KLZmuqzIwq02EfxxYlzohZredR3xTL
### get hot courses
POST http://localhost:8000/api/hot-courses HTTP/1.1
Accept: application/json
Authorization: Bearer 1|Y75na4O3u1KLZmuqzIwq02EfxxYlzohZredR3xTL
### get hot cousrses the next page
POST http://localhost:8000/api/hot-courses?page=2 HTTP/1.1
Accept: application/json
Authorization: Bearer 1|Y75na4O3u1KLZmuqzIwq02EfxxYlzohZredR3xTL
### course details, params id
POST http://localhost:8000/api/course-details HTTP/1.1
Authorization: Bearer 1|Y75na4O3u1KLZmuqzIwq02EfxxYlzohZredR3xTL
Content-Type: 'application/json'
{
"id_course": "2"
}
### post quize checker
POST http://localhost:8000/api/post-quiz HTTP/1.1
Accept: application/json
Authorization: Bearer 1|Y75na4O3u1KLZmuqzIwq02EfxxYlzohZredR3xTL
Content-Type: 'application/json'
{
"highest_score": "100",
// not do
}
### view instructor profie
POST http://localhost:8000/api/instructor-profile HTTP/1.1
Accept: application/json
Authorization: Bearer 1|Y75na4O3u1KLZmuqzIwq02EfxxYlzohZredR3xTL
Content-Type: 'application/json'
{
"id": "2"
}
### get test auth token
POST http://localhost:8000/api/get HTTP/1.1