Posts

The Comments API supports managing posts.

Create post

POST /api/apps/{id}/posts

Creates a new post in the specified Posts app.

Sample request

$ curl {WEAVY_SERVER}/api/apps/1/posts
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"
-H "Content-Type: application/json"
-d "{ 'text': 'This is a post' }"

Parameters

Name Type Required Description
id integer True App id

Request body

application/json

{
  "blobs?": [
    "integer"
  ],
  "embed_id?": "integer",
  "meeting_id?": "integer",
  "options?": [
    {
      "text": "string"
    }
  ],
  "text?": "string",
  "metadata?": {},
  "tags?": [
    "string"
  ]
}

Note. Properties marked with ? are optional.

Responses

Status code 200

application/json

{
  "comment_count": "integer",
  "comments": [
    "object"
  ],
  "is_subscribed": "boolean",
  "id": "integer",
  "app_id": "integer",
  "text": "string",
  "html": "string",
  "plain": "string",
  "attachment_count": "integer",
  "attachments": [
    "object"
  ],
  "embed_id": "integer",
  "meeting_id": "integer",
  "option_count": "integer",
  "options": [
    "object"
  ],
  "reactions": [
    "object"
  ],
  "tags": [
    "string"
  ],
  "created_at": "string",
  "created_by_id": "integer",
  "modified_at": "string",
  "modified_by_id": "integer",
  "is_trashed": "boolean"
}

List posts

GET /api/apps/{id}/posts

List posts in the specified Posts app.

Sample request

$ curl {WEAVY_SERVER}/api/apps/1/posts?top=50
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"

Parameters

Name Type Required Description
id integer True App id.
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 post

GET /api/posts/{id}

Gets a post by id.

Sample request

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

Parameters

Name Type Required Description
id integer True Id of the post.
trashed boolean False

Responses

Status code 200

application/json

{
  "comment_count": "integer",
  "comments": [
    "object"
  ],
  "is_subscribed": "boolean",
  "id": "integer",
  "app_id": "integer",
  "text": "string",
  "html": "string",
  "plain": "string",
  "attachment_count": "integer",
  "attachments": [
    "object"
  ],
  "embed_id": "integer",
  "meeting_id": "integer",
  "option_count": "integer",
  "options": [
    "object"
  ],
  "reactions": [
    "object"
  ],
  "tags": [
    "string"
  ],
  "created_at": "string",
  "created_by_id": "integer",
  "modified_at": "string",
  "modified_by_id": "integer",
  "is_trashed": "boolean"
}

Update post

PATCH /api/posts/{id}

Updates a post.

Sample request

$ curl -X PATCH {WEAVY_SERVER}/api/posts/1
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"
-H "Content-Type: application/json"
-d "{ 'text': 'This is an updated post' }"

Parameters

Name Type Required Description
id integer True Id of the post.

Request body

application/json

{
  "attachments?": [
    "integer"
  ],
  "blobs?": [
    "integer"
  ],
  "embed_id?": "integer",
  "meeting_id?": "integer",
  "options?": [
    {
      "id?": "integer",
      "text": "string"
    }
  ],
  "text?": "string",
  "metadata?": {},
  "tags?": [
    "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"
}
Status code 400

application/json

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

Delete post

DELETE /api/posts/{id}

Delete a post.

Sample request

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

Parameters

Name Type Required Description
id integer True Id of the post.

Responses

Status code 204

No Content


Subscribe to post

POST /api/posts/{id}/subscribe

Subscribe to notifications for activity on a post.

Sample request

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

Parameters

Name Type Required Description
id integer True Id of the post.

Responses

Status code 200

application/json

{
  "comment_count": "integer",
  "comments": [
    "object"
  ],
  "is_subscribed": "boolean",
  "id": "integer",
  "app_id": "integer",
  "text": "string",
  "html": "string",
  "plain": "string",
  "attachment_count": "integer",
  "attachments": [
    "object"
  ],
  "embed_id": "integer",
  "meeting_id": "integer",
  "option_count": "integer",
  "options": [
    "object"
  ],
  "reactions": [
    "object"
  ],
  "tags": [
    "string"
  ],
  "created_at": "string",
  "created_by_id": "integer",
  "modified_at": "string",
  "modified_by_id": "integer",
  "is_trashed": "boolean"
}

Unsubscribe to post

POST /api/posts/{id}/unsubscribe

Unsubscribe to notifications for activity on a post.

Sample request

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

Parameters

Name Type Required Description
id integer True Id of the post.

Responses

Status code 200

application/json

{
  "comment_count": "integer",
  "comments": [
    "object"
  ],
  "is_subscribed": "boolean",
  "id": "integer",
  "app_id": "integer",
  "text": "string",
  "html": "string",
  "plain": "string",
  "attachment_count": "integer",
  "attachments": [
    "object"
  ],
  "embed_id": "integer",
  "meeting_id": "integer",
  "option_count": "integer",
  "options": [
    "object"
  ],
  "reactions": [
    "object"
  ],
  "tags": [
    "string"
  ],
  "created_at": "string",
  "created_by_id": "integer",
  "modified_at": "string",
  "modified_by_id": "integer",
  "is_trashed": "boolean"
}

Trash post

POST /api/posts/{id}/trash

Move a post to the trash.

Sample request

$ curl -X POST {WEAVY_SERVER}/api/posts/1/trash
-H "Authorization: Bearer {WEAVY_APIKEY}"

Parameters

Name Type Required Description
id integer True Id of the post to trash.

Responses

Status code 200

application/json

{
  "comment_count": "integer",
  "comments": [
    "object"
  ],
  "is_subscribed": "boolean",
  "id": "integer",
  "app_id": "integer",
  "text": "string",
  "html": "string",
  "plain": "string",
  "attachment_count": "integer",
  "attachments": [
    "object"
  ],
  "embed_id": "integer",
  "meeting_id": "integer",
  "option_count": "integer",
  "options": [
    "object"
  ],
  "reactions": [
    "object"
  ],
  "tags": [
    "string"
  ],
  "created_at": "string",
  "created_by_id": "integer",
  "modified_at": "string",
  "modified_by_id": "integer",
  "is_trashed": "boolean"
}
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"
}

Restore post

POST /api/posts/{id}/restore

Restore a post from the trash.

Sample request

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

Parameters

Name Type Required Description
id integer True Id of the post to restore.

Responses

Status code 200

application/json

{
  "comment_count": "integer",
  "comments": [
    "object"
  ],
  "is_subscribed": "boolean",
  "id": "integer",
  "app_id": "integer",
  "text": "string",
  "html": "string",
  "plain": "string",
  "attachment_count": "integer",
  "attachments": [
    "object"
  ],
  "embed_id": "integer",
  "meeting_id": "integer",
  "option_count": "integer",
  "options": [
    "object"
  ],
  "reactions": [
    "object"
  ],
  "tags": [
    "string"
  ],
  "created_at": "string",
  "created_by_id": "integer",
  "modified_at": "string",
  "modified_by_id": "integer",
  "is_trashed": "boolean"
}

Indicate typing post

PUT /api/apps/{id}/posts/typing

Indicate that the authenticated user is writing a post.

Sample request

$ curl -X PUT {WEAVY_SERVER}/api/apps/1/posts/typing
-H "Authorization: Bearer {ACCESS_TOKEN}"

Parameters

Name Type Required Description
id integer True App id.

Responses

Status code 204

No Content


Weavy Docs