-
Notifications
You must be signed in to change notification settings - Fork 0
Favourite Controller
JainalGandhi edited this page May 17, 2020
·
6 revisions
Method Type: POST (authentication required
)
Description: Favourites the inputted PostId for the authenticated user making the request
Input Parameter | Type | Description |
---|---|---|
PostId | int | The PostId to be favourited 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 favourited by the user | - |
201 Created
|
A Favourite with the PostId and the User was successfully created | - |
Method Type: POST (authentication required
)
Description: Deletes a Favourite with the inputted PostId for the authenticated user making the request
Input Parameter | Type | Description |
---|---|---|
PostId | int | The PostId to be unfavourited 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 Favourite with the PostId was found for the user | - |
200 OK
|
A Favourite with the PostId and the User was successfully deleted | - |
Method Type: GET (authentication required
)
Description: Gets the Favourited 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 favourited 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 favourited by the user with the inputted after_id could be found | - |
200 Ok
|
The list of favourited Posts was successfully retrieved | List of PostDto |
Jainal Gandhi | Harman Lamba | Eric Leung | Salma Sanad
Made with love 👨👨👧👦💖