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

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

Service methods

Messenger methods that do not belong to a single section: the forms for creating a task or a flow from a chat, context for chat bots, a Zoom meeting, the update state and counters, plan restrictions, promo hints, the user's department and the desktop app logout.

Scope: im | Base URL: https://vibecode.bitrix24.com/v1 | Authorization: X-Api-Key

Task form

GET /v1/chats/:dialogId/task-form

Prepares the data for the form that creates a task from a chat, but does not create the task itself: the user fills in and saves the form in Bitrix24.

Parameters

Parameter Type Required Description
ParameterdialogId (path) Typestring Requiredyes DescriptionDialog ID: chat123 for a group chat, a user ID for a private chat, me for the chat with yourself. chat123 is the id field of a recent dialogs row, a user ID comes from the user list

There are no query parameters. messageId in the query is rejected with 400 — the form for a message is described on the Task form for a message page.

Examples

curl — personal key

Terminal
curl "https://vibecode.bitrix24.com/v1/chats/chat42/task-form" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl "https://vibecode.bitrix24.com/v1/chats/chat42/task-form" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/chat42/task-form', {
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})

const { data } = await res.json()
console.log('Form:', data.link, 'assignee:', data.params.responsibleId)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/chat42/task-form', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { data } = await res.json()
console.log('Form:', data.link)

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typeobject DescriptionForm data
Fielddata.link Typestring DescriptionRelative link to the task creation form in Bitrix24: to open the form, prepend your Bitrix24 address to it
Fielddata.params Typeobject DescriptionForm fields. Their set depends on the chat — see the paragraph after the table
Fielddata.params.responsibleId Typenumber DescriptionAssignee — the calling user
Fielddata.params.imChatId Typenumber DescriptionChat ID
Fielddata.params.auditors Typestring DescriptionObservers — comma-separated IDs of the chat members except the caller, no more than 50. A group or project chat has no observers
Fielddata.params.groupId Typenumber | null DescriptionGroup or project ID — for a group or project chat
Fielddata.params.isTasksV2 Typeboolean Descriptiontrue — the new version of tasks is enabled in Bitrix24. The response then includes the fields below
Fielddata.params.entityId Typenumber DescriptionChat ID
Fielddata.params.subEntityId Typenull DescriptionMessage ID. Always null in the form for a chat
Fielddata.params.taSec, data.params.taEl Typestring DescriptionSource labels for Bitrix24 analytics
Fielddata.params.description Typenull DescriptionTask description. Always null in the form for a chat

The contents of params depend on the chat and the Bitrix24 settings: Open Channels chats carry a CRM binding, and with the previous version of tasks the isTasksV2 field and the fields below it are absent.

Response example

JSON
{
  "success": true,
  "data": {
    "link": "/company/personal/user/1/tasks/task/edit/0/?ta_sec=chat&ta_el=chat_context_menu",
    "params": {
      "responsibleId": 1,
      "imChatId": 42,
      "auditors": "4",
      "isTasksV2": true,
      "entityId": 42,
      "subEntityId": null,
      "taSec": "chat",
      "taEl": "chat_context_menu",
      "description": null,
      "groupId": null
    }
  }
}

Error response example

400 — messageId was passed:

JSON
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "Query parameter `messageId` is not accepted by GET /v1/chats/:dialogId/task-form: the task form of a message is POST /v1/chats/messages/:messageId/task-form."
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionA query parameter was passed — the operation accepts none
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no Bitrix24 tokens configured
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the im scope
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is read-only: the call may make the key owner a chat member
HTTP404 CodeENTITY_NOT_FOUND DescriptionBitrix24 returned "not found". The Bitrix24 code is in error.b24Code
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 returned an error. The Bitrix24 code is in error.b24Code. TASK_ACCESS_ERROR — no access to the chat, TASKS_NOT_INSTALLED — the tasks module is not installed
HTTP502 CodeME_ALIAS_RESOLUTION_FAILED DescriptionFailed to resolve the current user for me
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionBitrix24 is unavailable or returned a server error

The full list of common API errors — Errors.

See also