Toggle Save Post API
This API endpoint allows the authenticated user to toggle post save the post.
If the user has already saved the target post, sending the same request will remove the saved post, and vice versa.
Path Parameters
post id
Query Parameters
Client API token
Header Parameters
user access token
client access token
timestamp of token expiry
access token type
user uid
- 200
- 401
- 404
- 500
OK
Response Headers
Schema
{
"saved": true
}
Toggle Save Post API (Save Post)
{
"saved": true
}
Toggle Save Post API (Unsave Post)
{
"saved": false
}
Unauthorized response, api will respond with this 401 eithr user is not logged in or do not have permission to perform some action. Like creating a post in a room, but user is not member of room.
System will also return 401 if api token is missing or invlaid.
Schema
Default value: 401
Default value: false
{
"errors": [
"string"
],
"status": 401,
"success": false
}
{
"errors": [
"You need to sign in or sign up before continuing."
],
"success": false
}
{
"message": "You don't have permission!",
"status": 401,
"success": false
}
Not Found
Schema
{
"status": 0,
"success": true,
"error": "string"
}
{
"status": 404,
"success": false,
"error": "Couldn't find Post with 'id'=27000000"
}
Internal server error, api will respond with 500 if something went wrong processing the request.
Schema
Default value: false
Default value: internal server error
error message
{
"success": false,
"message": "internal server error"
}