لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/feed/comments.md فهرس التوثيق — /llms.txt

مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.

Comments

Comments on Bitrix24 Feed posts: adding and deleting. Each operation runs in the context of a post — its id is passed in the path.

Scope: log

Add a comment

POST /v1/posts/:id/comments

Adds a comment to a Feed post. The post is identified by the ID in the path, and the comment text is passed in the request body.

Parameters

Parameter Type Required Description
Parameterid Typenumber Requiredyes DescriptionPost ID (path parameter). List: GET /v1/posts

Request fields (body)

Field Type Required Description
Fieldtext Typestring Requiredyes DescriptionComment text. Supports BB-code

Examples

curl — personal key

Terminal
curl -X POST https://vibecode.bitrix24.com/v1/posts/118/comments \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Approved, starting work."
  }'

curl — OAuth application

Terminal
curl -X POST https://vibecode.bitrix24.com/v1/posts/118/comments \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Approved, starting work."
  }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/posts/118/comments', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    text: 'Approved, starting work.',
  }),
})

const { success, data } = await res.json()
console.log('Comment ID:', data)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/posts/118/comments', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    text: 'Approved, starting work.',
  }),
})

const { success, data } = await res.json()

Response fields

Field Type Description
Fielddata Typenumber DescriptionID of the created comment

Response example

JSON
{
  "success": true,
  "data": 41
}

Error response example

404 — post not found:

JSON
{
  "success": false,
  "error": {
    "code": "POST_NOT_FOUND",
    "message": "Post 999999999 not found or not accessible with this key."
  }
}

Errors

HTTP Code Description
HTTP400 CodeMISSING_PARAMS DescriptionThe text parameter is missing
HTTP403 CodeCOMMENT_ACCESS_DENIED DescriptionNo permission to comment on this post
HTTP404 CodePOST_NOT_FOUND DescriptionNo post found with the given id
HTTP409 CodeDUPLICATE_COMMENT DescriptionA repeated comment with the same text
HTTP403 CodeSCOPE_DENIED DescriptionThe API key lacks the log scope
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no access tokens configured

The full list of common API errors — Errors.

See also