-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUser.html
111 lines (100 loc) · 2.69 KB
/
User.html
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
<p><code>Authentication: bearer TOKEN</code></p>
<ul>
<li>Get profile</li>
</ul>
<p><code>Method: get_profile
Route: GET /user/get_profile
Success:
{
"success": true,
"data": {
"_id": "5497ec1a5468615b38000000",
"avatar": "5497ec1a5468615b38000000.jpg",
"created_at": "2014-12-22T17:02:02.585+07:00",
"email": "root@to.or",
"full_name": null,
"is_banned": false,
"phone_number": null,
"total_like": 0,
"total_star": 0,
"updated_at": "2014-12-23T18:13:01.612+07:00",
"username": "root",
"has_password": true
}
}</code></p>
<ul>
<li>View profile</li>
</ul>
<p><code>Method: view_profile
Params: userId
Route: GET http://localhost:3000/user/view_profile
Success:
{
"success": true,
"data": {
"avatar": "5497ec1a5468615b38000000.jpg",
"full_name": null,
"is_banned": false,
"total_like": 0,
"username": "root",
"_id": "5497ec1a5468615b38000000"
}
}</code></p>
<ul>
<li>Update profile</li>
</ul>
<p><code>Method update_profile
Route: PUT http://localhost:3000/user/update_profile
Params: username, phone_number, full_name, fbId, :avatar (, email, password )
Success:
{
"success": true,
"message": "Thông tin đã được cập nhật",
"user": {
"_id": "5486ca4154686177c4000000",
"avatar": null,
"be_reported": 1,
"created_at": "2014-12-09T17:09:05.530+07:00",
"email": "seeder@seeding.com",
"full_name": "seeder",
"is_banned": false,
"phone_number": null,
"total_like": 0,
"total_star": 0,
"updated_at": "2014-12-22T15:42:32.477+07:00",
"username": "seeder",
"has_password": true
}
}</code></p>
<ul>
<li>Change password</li>
</ul>
<p><code>Method change_password
Route: PUT http://localhost:3000/user/change_password
Params: password, newPassword, confirmPassword
Success:
{
"success": true,
"message": "Password has been updated",
"user": {
"_id": "5497ec1a5468615b38000000",
"avatar": "5497ec1a5468615b38000000.jpg",
"created_at": "2014-12-22T17:02:02.585+07:00",
"email": "root@to.or",
"full_name": null,
"is_banned": false,
"phone_number": null,
"total_like": 0,
"total_star": 0,
"updated_at": "2014-12-23T18:13:01.612+07:00",
"username": "root",
"has_password": true
}
}</code></p>
<ul>
<li>Get avatar</li>
</ul>
<p><code>Method get_avatar
Route: GET http://localhost:3000/user/avatar/:userId
Success: (IMAGE)</code></p>
<p>For errors responses, see the <a href="#/response-status-codes">response status codes documentation</a>.</p>