-
Notifications
You must be signed in to change notification settings - Fork 0
PostLike Controller
JainalGandhi edited this page May 19, 2020
·
3 revisions
Method Type: POST (authentication required
)
Description: Likes the post associated with the inputted PostId for the authenticated user making the request
Input Parameter | Type | Description |
---|---|---|
PostId | int | The PostId of the Post to be liked by the user |
Status Code | Status Code Meaning | Response |
---|---|---|
401 Unauthorized
|
The request sent by the client could not be authenticated | - |
404 Not Found
|
No Post with the inputted PostId could be found | - |
200 OK
|
The Post corresponding to the PostId was already liked by the user | - |
201 Created
|
A PostLike with the PostId and the User was successfully created | - |
Method Type: POST (authentication required
)
Description: Deletes a PostLike with the inputted PostId for the authenticated user making the request
Input Parameter | Type | Description |
---|---|---|
PostId | int | The PostId to be unliked by the user |
Status Code | Status Code Meaning | Response |
---|---|---|
401 Unauthorized
|
The request sent by the client could not be authenticated | - |
404 Not Found
|
No Post with the inputted PostId could be found | - |
204 No Content
|
No PostLike with the PostId was found for the user | - |
200 OK
|
A PostLike with the PostId and the User was successfully deleted | - |
Method Type: GET (authentication required
)
Description: Gets the Liked posts of the authenticated user making the request
Input Parameter | Type | Description |
---|---|---|
limit | int (optional) | The number of posts to retrieve (default: uses GetPostDefaultLimit value in appsettings.json )
|
after_id | int (optional) | The last retrieved PostId (default: will start stream at the most recently liked post) |
Status Code | Status Code Meaning | Response |
---|---|---|
401 Unauthorized
|
The request sent by the client could not be authenticated | - |
404 Not Found
|
No Post that has been liked by the user with the inputted after_id could be found | - |
200 Ok
|
The list of liked Posts was successfully retrieved | List of PostDto |
Jainal Gandhi | Harman Lamba | Eric Leung | Salma Sanad
Made with love 👨👨👧👦💖