Reply API
對指定推文發表回覆
POST
hostname/api/tweets/:tweet_id/replies
Path Parameters
Name
Type
Description
tweet_id*
string
推文ID
Request Body
Name
Type
Description
comment*
String
回覆內容
{
"status": "success",
"data": {
"id": integer,
"comment": string
"UserId": integer,
"TweetId": integer,
"createdAt": timestamp,
"updatedAt": timestamp
},
"message": "成功發表回覆"
}
{
"code": 401,
"status": "error",
"message": "使用者未從登入驗證獲取憑證不予使用"
}
{
"code": 500,
"status": "error",
"message": "系統出錯"
}
{
"code": 404,
"status": "error",
"message": "對應推文不存在"
}
{
"code": 400,
"status": "error",
"message": "回覆文字不能為空白"
}
{
"code": 403,
"status": "error",
"message": "存取被拒"
}
瀏覽對應推文的回覆
GET
hostname/api/tweets/:tweet_id/replies
Path Parameters
Name
Type
Description
id*
string
推文ID
[
{
"id": 153,
"UserId": 2,
"TweetId": 2,
"comment": "我是評論喔2",
"createdAt": "2022-02-25T11:57:30.000Z",
"updatedAt": "2022-02-25T11:57:30.000Z",
"ReplyAuthor": {
"id": 2,
"account": "user1",
"email": "user1@example.com",
"name": "user1",
"avatar": "https://loremflickr.com/240/240?lock=56.95494978681978",
"cover": "https://loremflickr.com/720/240?lock=61.639579096349514",
"introduction": "Adipisci aut rerum quasi et autem vel velit voluptas est. Molestiae corrupti quibusdam quos qui perspiciatis. Voluptatem repellendus omnis voluptatem sunt. Est ",
"role": "user",
"likeCount": 0,
"tweetCount": 10,
"followingCount": 0,
"followerCount": 0,
"createdAt": "2022-02-25T08:46:13.000Z",
"updatedAt": "2022-02-25T08:46:13.000Z"
},
"TargetTweet": {
"id": 2,
"UserId": 2,
"description": "Totam blanditiis reiciendis saepe. Qui ducimus quia ex nesciunt possimus dolorum. Voluptatibus minima deserunt ea. Eum fugiat omnis nisi sed",
"likeCount": 0,
"replyCount": 5,
"createdAt": "2022-02-25T08:46:13.000Z",
"updatedAt": "2022-02-25T11:57:30.000Z",
"TweetAuthor": {
"id": 2,
"account": "user1",
"email": "user1@example.com",
"name": "user1",
"avatar": "https://loremflickr.com/240/240?lock=56.95494978681978",
"cover": "https://loremflickr.com/720/240?lock=61.639579096349514",
"introduction": "Adipisci aut rerum quasi et autem vel velit voluptas est. Molestiae corrupti quibusdam quos qui perspiciatis. Voluptatem repellendus omnis voluptatem sunt. Est ",
"role": "user",
"likeCount": 0,
"tweetCount": 10,
"followingCount": 0,
"followerCount": 0,
"createdAt": "2022-02-25T08:46:13.000Z",
"updatedAt": "2022-02-25T08:46:13.000Z"
}
}
},
{
"id": 152,
"UserId": 2,
"TweetId": 2,
"comment": "我是評論喔1",
"createdAt": "2022-02-25T11:56:45.000Z",
"updatedAt": "2022-02-25T11:56:45.000Z",
"ReplyAuthor": {
"id": 2,
"account": "user1",
"email": "user1@example.com",
"name": "user1",
"avatar": "https://loremflickr.com/240/240?lock=56.95494978681978",
"cover": "https://loremflickr.com/720/240?lock=61.639579096349514",
"introduction": "Adipisci aut rerum quasi et autem vel velit voluptas est. Molestiae corrupti quibusdam quos qui perspiciatis. Voluptatem repellendus omnis voluptatem sunt. Est ",
"role": "user",
"likeCount": 0,
"tweetCount": 10,
"followingCount": 0,
"followerCount": 0,
"createdAt": "2022-02-25T08:46:13.000Z",
"updatedAt": "2022-02-25T08:46:13.000Z"
},
"TargetTweet": {
"id": 2,
"UserId": 2,
"description": "Totam blanditiis reiciendis saepe. Qui ducimus quia ex nesciunt possimus dolorum. Voluptatibus minima deserunt ea. Eum fugiat omnis nisi sed",
"likeCount": 0,
"replyCount": 5,
"createdAt": "2022-02-25T08:46:13.000Z",
"updatedAt": "2022-02-25T11:57:30.000Z",
"TweetAuthor": {
"id": 2,
"account": "user1",
"email": "user1@example.com",
"name": "user1",
"avatar": "https://loremflickr.com/240/240?lock=56.95494978681978",
"cover": "https://loremflickr.com/720/240?lock=61.639579096349514",
"introduction": "Adipisci aut rerum quasi et autem vel velit voluptas est. Molestiae corrupti quibusdam quos qui perspiciatis. Voluptatem repellendus omnis voluptatem sunt. Est ",
"role": "user",
"likeCount": 0,
"tweetCount": 10,
"followingCount": 0,
"followerCount": 0,
"createdAt": "2022-02-25T08:46:13.000Z",
"updatedAt": "2022-02-25T08:46:13.000Z"
}
}
},
.
.
]
{
"code": 401,
"status": "error",
"message": "使用者未從登入驗證獲取憑證不予使用"
}
{
"code": 500,
"status": "error",
"message": "系統出錯"
}
{
"code": 404,
"status": "error",
"message": "對應推文不存在"
}
{
"code": 403,
"status": "error",
"message": "存取被拒"
}
Last updated