Reactions

The Reactions API enables you to create, list and delete reactions.

Create reaction (comment)

POST /api/comments/{id}/reactions

Create reaction for a comment.

Sample request

$ curl {WEAVY_SERVER}/api/comments/1/reactions
-H "Authorization: Bearer {ACCESS_TOKEN}"
-H "Content-Type: application/json"
-d "{ 'content': '😍' }"

Parameters

Name Type Required Description
id integer True Comment id.

Request body

application/json

{
  "content": "string"
}

Note. Properties marked with ? are optional.

Responses

Status code 204

No Content

Status code 404

application/json

{
  "type": "string",
  "title": "string",
  "status": "integer",
  "detail": "string",
  "instance": "string"
}

Delete reaction (comment)

DELETE /api/comments/{id}/reactions

Delete authenticated user's reaction to a comment.

Sample request

$ curl -X DELETE {WEAVY_SERVER}/api/comments/1/reactions
-H "Authorization: Bearer {ACCESS_TOKEN}"

Parameters

Name Type Required Description
id integer True Comment id.

Responses

Status code 200

Success

Status code 404

application/json

{
  "type": "string",
  "title": "string",
  "status": "integer",
  "detail": "string",
  "instance": "string"
}
Status code 400

application/json

{
  "type": "string",
  "title": "string",
  "status": "integer",
  "detail": "string",
  "instance": "string"
}

List reactions (comment)

GET /api/comments/{id}/reactions

List reactions for a comment.

Sample request

$ curl {WEAVY_SERVER}/api/comments/1/reactions
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"

Parameters

Name Type Required Description
id integer True Comment id.
content string False
q string False
tag string False
trashed boolean False
order_by string False
top integer False
skip integer False
count boolean False
count_only boolean False

Responses

Status code 200

application/json

{
  "data": [
    "object"
  ],
  "start": "integer",
  "end": "integer",
  "count": "integer"
}

Create reaction (message)

POST /api/messages/{id}/reactions

Create reaction for a message.

Sample request

$ curl {WEAVY_SERVER}/api/messages/1/reactions
-H "Authorization: Bearer {ACCESS_TOKEN}"
-H "Content-Type: application/json"
-d "{ 'content': '😍' }"

Parameters

Name Type Required Description
id integer True Message id.

Request body

application/json

{
  "content": "string"
}

Note. Properties marked with ? are optional.

Responses

Status code 204

No Content

Status code 404

application/json

{
  "type": "string",
  "title": "string",
  "status": "integer",
  "detail": "string",
  "instance": "string"
}

Delete reaction (message)

DELETE /api/messages/{id}/reactions

Delete authenticated user's reaction to a message.

Sample request

$ curl -X DELETE {WEAVY_SERVER}/api/messages/1/reactions
-H "Authorization: Bearer {ACCESS_TOKEN}"

Parameters

Name Type Required Description
id integer True Message id.

Responses

Status code 200

Success

Status code 404

application/json

{
  "type": "string",
  "title": "string",
  "status": "integer",
  "detail": "string",
  "instance": "string"
}
Status code 400

application/json

{
  "type": "string",
  "title": "string",
  "status": "integer",
  "detail": "string",
  "instance": "string"
}

List reactions (message)

GET /api/messages/{id}/reactions

List reactions for a message.

Sample request

$ curl {WEAVY_SERVER}/api/messages/1/reactions
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"

Parameters

Name Type Required Description
id integer True Message id.
content string False
q string False
tag string False
trashed boolean False
order_by string False
top integer False
skip integer False
count boolean False
count_only boolean False

Responses

Status code 200

application/json

{
  "data": [
    "object"
  ],
  "start": "integer",
  "end": "integer",
  "count": "integer"
}

Create reaction (post)

POST /api/posts/{id}/reactions

Create reaction for a post.

Sample request

$ curl {WEAVY_SERVER}/api/posts/1/reactions
-H "Authorization: Bearer {ACCESS_TOKEN}"
-H "Content-Type: application/json"
-d "{ 'content': '😍' }"

Parameters

Name Type Required Description
id integer True Post id.

Request body

application/json

{
  "content": "string"
}

Note. Properties marked with ? are optional.

Responses

Status code 204

No Content

Status code 404

application/json

{
  "type": "string",
  "title": "string",
  "status": "integer",
  "detail": "string",
  "instance": "string"
}

Delete reaction (post)

DELETE /api/posts/{id}/reactions

Delete authenticated user's reaction to a post.

Sample request

$ curl -X DELETE {WEAVY_SERVER}/api/posts/1/reactions
-H "Authorization: Bearer {ACCESS_TOKEN}"

Parameters

Name Type Required Description
id integer True Post id.

Responses

Status code 200

Success

Status code 404

application/json

{
  "type": "string",
  "title": "string",
  "status": "integer",
  "detail": "string",
  "instance": "string"
}
Status code 400

application/json

{
  "type": "string",
  "title": "string",
  "status": "integer",
  "detail": "string",
  "instance": "string"
}

List reactions (post)

GET /api/posts/{id}/reactions

List reactions for a post.

Sample request

$ curl {WEAVY_SERVER}/api/posts/1/reactions
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"

Parameters

Name Type Required Description
id integer True Post id.
content string False
q string False
tag string False
trashed boolean False
order_by string False
top integer False
skip integer False
count boolean False
count_only boolean False

Responses

Status code 200

application/json

{
  "data": [
    "object"
  ],
  "start": "integer",
  "end": "integer",
  "count": "integer"
}

Get reaction

GET /api/reactions/{id}

Get a reaction by id.

Sample request

$ curl {WEAVY_SERVER}/api/reactions/1
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"

Parameters

Name Type Required Description
id integer True Reaction id.

Responses

Status code 200

application/json

{
  "id": "integer",
  "content": "string",
  "created_at": "string",
  "created_by_id": "integer",
  "count": "integer"
}
Status code 404

application/json

{
  "type": "string",
  "title": "string",
  "status": "integer",
  "detail": "string",
  "instance": "string"
}

Delete reaction

DELETE /api/reactions/{id}

Delete a reaction.

Sample request

$ curl -X DELETE {WEAVY_SERVER}/api/reactions/1
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"

Parameters

Name Type Required Description
id integer True Reaction id.

Responses

Status code 200

Success

Status code 404

application/json

{
  "type": "string",
  "title": "string",
  "status": "integer",
  "detail": "string",
  "instance": "string"
}
Status code 400

application/json

{
  "type": "string",
  "title": "string",
  "status": "integer",
  "detail": "string",
  "instance": "string"
}

Weavy Docs