Reactions
Introduction
Reactions
are a quick and easy way to provide feedback to Reactable
entities via an emoji. Each User can only submit one Reaction
per Reactable
.
The Reactions
of all Users are then summarized in order to obtain a quick picture of user sentiment for the Reactable
.
Model Definition
Relations
Key | Relation | Type | Relation Field(s) |
---|---|---|---|
| Belongs to |
| |
|
| Morph to |
|
Reactable types
infoboardPost
- React to a InfoboardPost.infoboardComment
- React to a InfoboardComment.manualEntry
- React to a ManualEntry.chatMessage
- React to aChatMessages
.
Appends
The following appends
can be applied on all Reactable
entities:
reactions_summary
reactions_summary
Adds the reactions_summary
append to the response, containing the reaction
and the count
. The reaction counts are sorted from highest to lowest.
Example response:
List by reactable
List the Reactions
for given Reactable
.
Definition
GET
/api/reactions/{reactableType}/{reactableId}
Example Request
Example Response
Summary by reactable
Get a summary of Reactions
for given Reactable
. It has the same structure as the reactions_summary
append.
Definition
GET
/api/reactions/{reactableType}/{reactableId}/summary
Example Request
Example Response
Create or update
Create a new Reaction
. If the reaction for given reactable_type
, reactable_id
and the authenticated User's ID exits, it will be updated.
Definition
POST
/api/reactions
Request Keys
Key | Type | Description |
---|---|---|
| integer | The ID of the |
| string | The Reactable type of the |
| string | The emoji to react to the |
Keys with *
are required.
Example Request
Example Response
Delete
Delete an Reaction
by id
.
Definition
DELETE
/api/reactions/{id}
Example Request
Example Response
Last updated