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

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

Open Channel quick replies

Reply templates that an Open Channel operator inserts into a conversation with a client. This subsection reads a channel's replies and sections, and creates, edits and deletes replies.

Bitrix24 API: imopenlines.v2.QuickReply.* Scope: imopenlines

List quick replies

GET /v1/openline-configs/:lineId/quick-replies

Returns an Open Channel's quick replies together with its sections and the key user's permissions to view and create replies. Use the method to find a reply by text, get a reply ID to edit it, or get a section ID to create a reply.

Parameters

Parameter Type Required Default Description
ParameterlineId (path) Typeinteger Requiredyes Default— DescriptionOpen Channel ID. List: GET /v1/openline-configs
Parametersearch (query) Typestring Requiredno Default— DescriptionSearch string matched against the reply name and text
ParametersectionId (query) Typeinteger Requiredno Default— DescriptionID of a section of this channel from data.sections. Returns only the replies in this section
Parameteroffset (query) Typeinteger Requiredno Default0 DescriptionHow many records to skip from the start of the result set
Parameterlimit (query) Typeinteger Requiredno Default50 DescriptionHow many records to return, from 0 to 50. A value above 50 is reduced to 50. With 0 the replies array is empty, while totalCount, sections and permissions are returned

Pagination. One call returns at most 50 replies. To read all of them, increase offset by the number of records received until offset plus the length of replies reaches totalCount.

Examples

curl — personal key

Terminal
curl "https://vibecode.bitrix24.com/v1/openline-configs/3/quick-replies?limit=20" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl "https://vibecode.bitrix24.com/v1/openline-configs/3/quick-replies?limit=20" \
  -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/openline-configs/3/quick-replies?limit=20',
  { headers: { 'X-Api-Key': 'YOUR_API_KEY' } }
)
const { data } = await res.json()
console.log(`Replies: ${data.totalCount}`, data.replies)

JavaScript — OAuth application

javascript
const res = await fetch(
  'https://vibecode.bitrix24.com/v1/openline-configs/3/quick-replies?limit=20',
  {
    headers: {
      'X-Api-Key': 'YOUR_APP_KEY',
      'Authorization': 'Bearer USER_SESSION_TOKEN',
    },
  }
)
const { data } = await res.json()
console.log(`Replies: ${data.totalCount}`, data.replies)

Response fields

Field Type Description
Fieldsuccess Typeboolean Descriptiontrue on success
Fielddata.replies Typearray DescriptionQuick replies on the current page of the result set
Fielddata.replies[].id Typeinteger DescriptionQuick reply ID
Fielddata.replies[].name Typestring DescriptionReply name
Fielddata.replies[].text Typestring DescriptionReply text
Fielddata.replies[].sectionId Typeinteger DescriptionSection ID. 0 means the reply has no section
Fielddata.replies[].canEdit Typeboolean DescriptionWhether the key user can edit the reply
Fielddata.replies[].rating Typenumber | string DescriptionReply rating
Fielddata.sections Typearray DescriptionAll quick reply sections of this channel
Fielddata.sections[].id Typeinteger DescriptionSection ID. Passed in sectionId
Fielddata.sections[].name Typestring DescriptionSection name
Fielddata.sections[].code Typestring DescriptionSection symbolic code
Fielddata.totalCount Typeinteger DescriptionHow many replies match search and sectionId, regardless of offset and limit
Fielddata.permissions.canView Typeboolean DescriptionWhether the key user can view the channel's quick replies. With false, an empty replies array does not mean the channel has no replies
Fielddata.permissions.canCreate Typeboolean DescriptionWhether the key user can create quick replies in the channel

Response example

JSON
{
  "success": true,
  "data": {
    "replies": [
      {
        "id": 7277,
        "name": "Hello, an operator will reply within a minute",
        "text": "Hello, an operator will reply within a minute",
        "sectionId": 123,
        "canEdit": true,
        "rating": 1
      },
      {
        "id": 7279,
        "name": "Delivery within the city takes one to two business days",
        "text": "Delivery within the city takes one to two business days",
        "sectionId": 0,
        "canEdit": true,
        "rating": 1
      }
    ],
    "sections": [
      { "id": 123, "name": "Greeting", "code": "GREETING" },
      { "id": 125, "name": "Payment", "code": "PAYMENT" },
      { "id": 127, "name": "Delivery", "code": "DELIVERY" },
      { "id": 129, "name": "General", "code": "COMMON" }
    ],
    "totalCount": 2,
    "permissions": {
      "canView": true,
      "canCreate": true
    }
  }
}

Error response example

404 — there is no Open Channel with this lineId:

JSON
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Record not found"
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionlineId is not a positive integer
HTTP400 CodeINVALID_PARAMS Descriptionoffset or limit is negative or not an integer, or search is not a string
HTTP400 CodeINVALID_PARAMS DescriptionsectionId is not a non-negative integer
HTTP400 CodeINVALID_PARAMS DescriptionA query string parameter is passed twice or in object form, for example search=a&search=b or search[x]=a
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header was not passed
HTTP401 CodeTOKEN_MISSING DescriptionThe key has no valid authorization in Bitrix24
HTTP403 CodeSCOPE_DENIED DescriptionThe key lacks the imopenlines scope
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionBitrix24 denied access to the key user
HTTP404 CodeENTITY_NOT_FOUND DescriptionThere is no Open Channel with this lineId
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 returned an error. The text is in message
HTTP429 CodeRATE_LIMITED DescriptionThe method's own limit was exceeded. The overall platform ceiling is 120 requests per minute per portal and is split across platform replicas, so the code may arrive before the 120th request. The effective value is in the x-ratelimit-limit header
HTTP502 CodeOPENLINE_OPERATOR_FAILED DescriptionBitrix24 returned a response of an unexpected shape
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionBitrix24 is unavailable
HTTP503 CodeBITRIX_TIMEOUT DescriptionBitrix24 did not respond in time. A read is safe to retry

Full list of common API errors — Errors.

Known specifics

Each channel has its own sections and replies. data.sections lists only the sections of the channel from the path, and passing another channel's section ID in sectionId returns no replies here. Filtering by a non-existent section returns an empty replies array with totalCount: 0, not an error.

See also