-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.http
103 lines (72 loc) · 2.98 KB
/
app.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
//API-1
//REGISTER NEW USER
POST http://localhost:3000/register/
Content-Type: application/json
{
"username": "adam_richard",
"password": "richard_567",
"name": "Adam Richard",
"gender": "male"
}
###
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IkpvZUJpZGVuIiwiaWF0IjoxNjY2OTM4NjI4fQ.JxXV9GIl9NXSH7jVeCkuFEZH4pM_MCdsXVRwx3u7FvU
###
//API-2
//USER LOGIN IF EXISTS IN DB
POST http://localhost:3000/login/
Content-Type: application/json
{
"username":"JoeBiden",
"password":"biden@123"
}
###
//API-3
// Returns the latest tweets of people whom the user follows. Return 4 tweets at a time
GET http://localhost:3000/user/tweets/feed/
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IkpvZUJpZGVuIiwiaWF0IjoxNjY2OTM4NjI4fQ.JxXV9GIl9NXSH7jVeCkuFEZH4pM_MCdsXVRwx3u7FvU
###
//API-4
//Returns the list of all names of people whom the user follows
GET http://localhost:3000/user/following/
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IkpvZUJpZGVuIiwiaWF0IjoxNjY2OTM4NjI4fQ.JxXV9GIl9NXSH7jVeCkuFEZH4pM_MCdsXVRwx3u7FvU
###
//API-5
//Returns the list of all names of people who follows the user
GET http://localhost:3000/user/followers/
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IkpvZUJpZGVuIiwiaWF0IjoxNjY2OTM4NjI4fQ.JxXV9GIl9NXSH7jVeCkuFEZH4pM_MCdsXVRwx3u7FvU
###
//API-6
//GET TWEETS FOLLOWED BY USER
GET http://localhost:3000/tweets/1/
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IkpvZUJpZGVuIiwiaWF0IjoxNjY2OTM4NjI4fQ.JxXV9GIl9NXSH7jVeCkuFEZH4pM_MCdsXVRwx3u7FvU
###
//API-7
//If the user requests a tweet of a user he is following,
// return the list of usernames who liked the tweet
GET http://localhost:3000/tweets/1/likes/
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IkpvZUJpZGVuIiwiaWF0IjoxNjY2OTM4NjI4fQ.JxXV9GIl9NXSH7jVeCkuFEZH4pM_MCdsXVRwx3u7FvU
###
//API-8
//If the user requests a tweet of a user he is following,
// return the list of replies
GET http://localhost:3000/tweets/1/replies/
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IkpvZUJpZGVuIiwiaWF0IjoxNjY2OTM4NjI4fQ.JxXV9GIl9NXSH7jVeCkuFEZH4pM_MCdsXVRwx3u7FvU
###
//API-9
//Returns a list of all tweets of the user
GET http://localhost:3000/user/tweets/
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IkpvZUJpZGVuIiwiaWF0IjoxNjY2OTM4NjI4fQ.JxXV9GIl9NXSH7jVeCkuFEZH4pM_MCdsXVRwx3u7FvU
###
//API-10
//Create a tweet in the tweet table
POST http://localhost:3000/user/tweets/
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IkpvZUJpZGVuIiwiaWF0IjoxNjY2OTM4NjI4fQ.JxXV9GIl9NXSH7jVeCkuFEZH4pM_MCdsXVRwx3u7FvU
{
"tweet": "The Mornings..."
}
###
//API-11
//DELETE TWEET POSTED BY USER
DELETE http://localhost:3000/tweets/7/
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IkpvZUJpZGVuIiwiaWF0IjoxNjY2OTM4NjI4fQ.JxXV9GIl9NXSH7jVeCkuFEZH4pM_MCdsXVRwx3u7FvU