POST /tweet
body : {
message: string
}
returns: 200 OK (with twitter ID, tweetId)
POST /follow
body: {
followerId: string
followeeId: string
}
returns 404 not found (if followerId/followeeId does not exist), else 200 OK
POST /unfollow
body: {
followerId: string
followeeId: string
}
returns 404 not found (if followerId/followeeId does not exist), else 200 OK
POST /like
body: {
tweetId: int
}
returns: 404 not found (if tweetId not found), else 200 OK
POST /unlike
body: {
tweetId: int
}
returns: 404 Not found (if tweetId not found), else 200 OK
GET /get-tweets
body: {
userId: string
page: int (each page has k tweets)
}
return 200 OK with k tweets
DELETE /delete-tweet
body : {
tweetId: int
}
return 200 OK if tweet exists, else 404 Not found
POST /create-account
body: {
userId: string
}
return 200 OK if userId does not exist, else 400 bad request
DELETE /delete-account
body: {
userId: string
}
return 200 OK if userId exists, else 400 bad request
GET /search-account
body: {
prefix: string
}
return 200 OK with list of accounts matching prefix string, else return 404 not found
GET /search-tweet
body: {
prefix: string
}
returns 200 OK with list of tweet matching prefix string, else return 404 not found
POST /tweet
body : {message: string}
returns: 200 OK (with twitter ID, tweetId)
POST /follow
body: {
followerId: string
followeeId: string
}
returns 404 not found (if followerId/followeeId does not exist), else 200 OK
POST /unfollow
body: {
followerId: string
followeeId: string
}
returns 404 not found (if followerId/followeeId does not exist), else 200 OK
POST /like
body: {
tweetId: int
}
returns: 404 not found (if tweetId not found), else 200 OK
POST /unlike
body: {
tweetId: int
}
returns: 404 Not found (if tweetId not found), else 200 OK
GET /get-tweets
body: {
userId: string
page: int (each page has k tweets)
}
return 200 OK with k tweets
DELETE /delete-tweet
body : {
tweetId: int
}
return 200 OK if tweet exists, else 404 Not found
DELETE /delete-account
body: {
userId: string
}
return 200 OK if userId exists, else 400 bad request
POST /create-account
body: {
userId: string
}
return 200 OK if userId does not exist, else 400 bad request
GET /search-account
body: {
prefix: string
}
return 200 OK with list of accounts matching prefix string, else return 404 not found
GET /search-tweet
body: {
prefix: string
}
returns 200 OK with list of tweet matching prefix string, else return 404 not found
API gateway
Tweet CRUD service
Follower CRUD service
Tweet CRUD server
Follower database