Posts
The Comments API supports managing posts.
Create post
Creates a new post in the specified posts app.
POST /api/apps/{id}/posts
Path parameters
id
integer requiredApp id.
Body parameters
blobs
array of integersIds of blobs to attach.
embed_id
integerId of embed to attach.
meeting_id
integerId of meeting to attach.
options
array of objectsList of poll options to attach.
text
stringThe message text.
metadata
objectAdditional metadata properties, e.g.
{ "color": "blue", "size": "XL" }
.
tags
array of stringsA list of tags to associate with the item.
Response codes
200 Success
{
"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"
],
"metadata": "object",
"tags": [
"string"
],
"created_at": "string",
"created_by_id": "integer",
"modified_at": "string",
"modified_by_id": "integer",
"is_trashed": "boolean"
}
Code sample
curl https://{WEAVY-SERVER}/api/apps/1/posts
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
-H "Content-Type: application/json"
-d "{ 'text': 'This is a post' }"
List posts
List posts in the specified posts app.
GET /api/apps/{id}/posts
Path parameters
id
integer requiredApp id.
Query parameters
q
stringA query used to find matching items.
tag
stringList items with the specified tag.
trashed
booleanIndicates whether trashed items should be listed (default is
false
). Specifynull
to return both trashed and non-trashed items.
order_by
stringSpecifies the sort order and direction for the listing, e.g. "
name
" or "name+desc
"
top
integerMaximum number of items to return in the listing. Should be a value between
0
and100
. Default is25
.
skip
integerThe number of items to skip. Used together with
top
to return a specific range of items (for pagination).
count
booleanfalse
to skip counting the total number of matching items; default istrue
.
count_only
booleantrue
to only return the number of matching items; when this is specified the response will only contain thecount
property.
Response codes
200 Success
{
"data": [
"object"
],
"start": "integer",
"end": "integer",
"count": "integer"
}
Code sample
curl https://{WEAVY-SERVER}/api/apps/1/posts?top=50
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Get post
Gets a post by id.
GET /api/posts/{id}
Path parameters
id
integer requiredId of the post.
Query parameters
trashed
booleantrue
to return post even if trashed.
Response codes
200 Success
{
"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"
],
"metadata": "object",
"tags": [
"string"
],
"created_at": "string",
"created_by_id": "integer",
"modified_at": "string",
"modified_by_id": "integer",
"is_trashed": "boolean"
}
Code sample
curl https://{WEAVY-SERVER}/api/posts/1
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Update post
Updates a post.
PATCH /api/posts/{id}
Path parameters
id
integer requiredId of the post.
Body parameters
attachments
array of integersIds of attached files.
blobs
array of integersIds of additional blobs to attach.
embed_id
integerId of embed to attach.
meeting_id
integerId of meeting to attach.
options
array of objectsList of poll options for the item.
text
stringThe message text.
metadata
objectAdditional metadata properties, e.g.
{ "color": "blue", "size": "XL" }
.
tags
array of stringsA list of tags to associate with the item.
Response codes
204 No Content
404 Not Found
400 Bad Request
Code sample
$ curl -X PATCH {WEAVY_SERVER}/api/posts/1
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
-H "Content-Type: application/json"
-d "{ 'text': 'This is an updated post' }"
Delete post
Delete a post.
DELETE /api/posts/{id}
Path parameters
id
integer requiredId of the post.
Response codes
204 No Content
Code sample
$ curl -X DELETE {WEAVY_SERVER}/api/posts/1
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Subscribe to post
Subscribe to notifications for activity on a post.
POST /api/posts/{id}/subscribe
Path parameters
id
integer requiredId of the post.
Response codes
200 Success
{
"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"
],
"metadata": "object",
"tags": [
"string"
],
"created_at": "string",
"created_by_id": "integer",
"modified_at": "string",
"modified_by_id": "integer",
"is_trashed": "boolean"
}
Code sample
$ curl -X POST {WEAVY_SERVER}/api/posts/1/subscribe
-H "Authorization: Bearer {ACCESS-TOKEN}"
Unsubscribe to post
Unsubscribe to notifications for activity on a post.
POST /api/posts/{id}/unsubscribe
Path parameters
id
integer requiredId of the post.
Response codes
200 Success
{
"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"
],
"metadata": "object",
"tags": [
"string"
],
"created_at": "string",
"created_by_id": "integer",
"modified_at": "string",
"modified_by_id": "integer",
"is_trashed": "boolean"
}
Code sample
$ curl -X POST {WEAVY_SERVER}/api/posts/1/unsubscribe
-H "Authorization: Bearer {ACCESS-TOKEN}"
Trash post
Move a post to the trash.
POST /api/posts/{id}/trash
Path parameters
id
integer requiredId of the post to trash.
Response codes
200 Success
{
"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"
],
"metadata": "object",
"tags": [
"string"
],
"created_at": "string",
"created_by_id": "integer",
"modified_at": "string",
"modified_by_id": "integer",
"is_trashed": "boolean"
}
404 Not Found
400 Bad Request
Code sample
$ curl -X POST {WEAVY_SERVER}/api/posts/1/trash
-H "Authorization: Bearer {API-KEY}"
Restore post
Restore a post from the trash.
POST /api/posts/{id}/restore
Path parameters
id
integer requiredId of the post to restore.
Response codes
200 Success
{
"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"
],
"metadata": "object",
"tags": [
"string"
],
"created_at": "string",
"created_by_id": "integer",
"modified_at": "string",
"modified_by_id": "integer",
"is_trashed": "boolean"
}
Code sample
$ curl -X POST {WEAVY_SERVER}/api/posts/1/restore
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Indicate typing
Indicate that the authenticated user is writing a post.
PUT /api/apps/{id}/posts/typing
Path parameters
id
integer requiredId of app where user is typing.
Response codes
204 No Content
Code sample
$ curl -X PUT {WEAVY_SERVER}/api/apps/1/posts/typing
-H "Authorization: Bearer {ACCESS-TOKEN}"