Reactions
Introduction
Reactions let a User attach one emoji value to a resource with the Reactions capability. Posting again for the same user and resource updates that record.
Model Definition
Reactable Types
chatMessage- Attaches the Reaction to a ChatMessage.infoboardComment- Attaches the Reaction to an InfoboardComment.infoboardPost- Attaches the Reaction to an InfoboardPost.manualEntry- Attaches the Reaction to a ManualEntry.
Capabilities
Notifications - Creating or changing a reaction can trigger notifications according to the target resource and notification settings.
Relations
reactable
Reactable resource
Morph to
reactable_type, reactable_id
Reactable resources can return reactions_summary as an append. It contains emoji/count pairs sorted by descending count.
List by Reactable
List Reactions for one reactable entity.
Definition
GET /api/reactions/{reactableType}/{reactableId}
Route Parameters
reactableId
integer
Existing reactable ID.
Request Keys
selects
string
All fields
Comma-separated fields to return.
relations
string
Default relations
Pipe-separated relations to include.
Example Request
Example Response
Summary by Reactable
Summarize Reactions for one reactable entity.
Definition
GET /api/reactions/{reactableType}/{reactableId}/summary
Route Parameters
reactableId
integer
Existing reactable ID.
Example Request
Example Response
Show
Show one Reaction.
Definition
GET /api/reactions/{reaction}
Route Parameters
reaction
integer
Reaction ID.
Request Keys
selects
string
All fields
Comma-separated fields to return.
relations
string
Default relations
Pipe-separated relations to include.
Example Request
Example Response
Create or Update
Create or update the current user's Reaction for one reactable entity.
Definition
POST /api/reactions
Request Keys
reactable_id*
integer
-
Existing reactable ID.
value*
string
-
Emoji value, at most 10 characters.
Keys with * are required.
Behavior
user_id is always taken from the authenticated user. The complete request combination determines whether the response is a newly created reaction or the updated existing reaction.
Example Request
Example Response
Delete
Delete an existing Reaction.
Definition
DELETE /api/reactions/{reaction}
Route Parameters
reaction
integer
Reaction ID.
Example Request
Example Response
Last updated