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

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

Ratings (CSAT)

The method ships in the imopenlines 26.700.0 update and is not yet available on all Bitrix24 accounts. If the update has not reached your Bitrix24 account yet, the API returns 422 METHOD_NOT_YET_AVAILABLE — this means the method has not been released on the account yet, not that the integration is broken.

POST /v1/openlines/ratings/search

A list of sessions with a customer rating (like / dislike) over a period — for customer satisfaction (CSAT) reports and feedback export. Sessions without a customer rating do not appear in the list.

Request fields (body)

Field Type Required Description
FielddateVoteFrom Typestring Requiredyes DescriptionStart of the rating period, ISO 8601. The dateVoteFrom..dateVoteTo period must not exceed 1 year
FielddateVoteTo Typestring Requiredyes DescriptionEnd of the rating period, ISO 8601
FieldconfigId Typenumber Requiredno DescriptionOpen Channel identifier. Source: GET /v1/openline-configs
FieldconfigIdList Typenumber[] Requiredno DescriptionList of Open Channels
FieldoperatorId Typenumber Requiredno DescriptionOperator identifier. Source: GET /v1/users
FieldoperatorIdList Typenumber[] Requiredno DescriptionList of operators
Fieldsource Typestring Requiredno DescriptionConnector code
FieldsourceList Typestring[] Requiredno DescriptionList of connector codes
Fieldvote Typestring Requiredno DescriptionCustomer rating: like / dislike. Without the parameter, all rated sessions are returned
FieldhasVoteHead Typeboolean Requiredno DescriptionWhether there is a supervisor rating. Accepts true/false and Y/N
Fieldlimit Typenumber Requiredno DescriptionPage size, 1..200 (default 50)
Fieldoffset Typenumber Requiredno DescriptionPagination offset (default 0)

The dateVoteFrom/dateVoteTo period is required — this restriction protects against heavy queries over the session table. If the customer rating is disabled on an Open Channel, the method returns an empty list: such a channel has no rated sessions.

Examples

curl — personal key

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/openlines/ratings/search" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "configId": 3,
    "vote": "like",
    "dateVoteFrom": "2026-06-01T00:00:00+00:00",
    "dateVoteTo": "2026-06-30T23:59:59+00:00"
  }'

curl — OAuth application

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/openlines/ratings/search" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "configId": 3,
    "vote": "like",
    "dateVoteFrom": "2026-06-01T00:00:00+00:00",
    "dateVoteTo": "2026-06-30T23:59:59+00:00"
  }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/openlines/ratings/search', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    configId: 3,
    vote: 'like',
    dateVoteFrom: '2026-06-01T00:00:00+00:00',
    dateVoteTo: '2026-06-30T23:59:59+00:00',
  }),
})
const { data } = await res.json()

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/openlines/ratings/search', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    configId: 3,
    vote: 'like',
    dateVoteFrom: '2026-06-01T00:00:00+00:00',
    dateVoteTo: '2026-06-30T23:59:59+00:00',
  }),
})
const { data } = await res.json()

Response fields

The response is { "success": true, "data": { "ratings": [...], "hasNextPage": bool } }.

Key Description
Keyratings[].sessionId DescriptionSession identifier
Keyratings[].configId DescriptionOpen Channel identifier
Keyratings[].operatorId DescriptionOperator identifier
Keyratings[].source DescriptionConnector code
Keyratings[].vote DescriptionCustomer rating (like / dislike)
Keyratings[].voteHead DescriptionSupervisor rating, a number 1..5 (null if the user lacks permission)
Keyratings[].commentHead DescriptionSupervisor comment (null if the user lacks permission)
Keyratings[].dateVote DescriptionDate the customer left the rating
Keyratings[].dateSessionClose DescriptionSession close date
KeyhasNextPage DescriptionWhether there is a next page (a field of the data envelope, not of an element)

Response example

JSON
{
  "success": true,
  "data": {
    "ratings": [
      {
        "sessionId": 1024,
        "configId": 3,
        "operatorId": 42,
        "source": "livechat",
        "vote": "like",
        "voteHead": 5,
        "commentHead": "Great work",
        "dateVote": "2026-06-15T14:53:00+00:00",
        "dateSessionClose": "2026-06-15T14:52:10+00:00"
      }
    ],
    "hasNextPage": false
  }
}

Error response example

400 — the rating period is missing:

JSON
{
  "success": false,
  "error": { "code": "MISSING_PARAMS", "message": "Required: dateVoteFrom, dateVoteTo (ISO 8601 strings)" }
}

Errors

HTTP Code When
HTTP403 CodeB24_TARIFF_RESTRICTION WhenThe Bitrix24 plan does not include Open Channels statistics (report_open_lines)
HTTP400 CodeINVALID_JSON_BODY WhenThe request body did not parse as JSON. The check runs before field validation, so the response says nothing about missing parameters
HTTP400 CodeMISSING_PARAMS WhenThe required dateVoteFrom/dateVoteTo are missing
HTTP422 CodeBITRIX_ERROR (error.b24Code: INVALID_FILTER) WhenAn invalid vote value or date format
HTTP422 CodeBITRIX_ERROR (error.b24Code: PERIOD_TOO_LARGE) WhenThe period exceeds 1 year
HTTP422 CodeBITRIX_ERROR (error.b24Code: OFFSET_TOO_LARGE) Whenoffset exceeds the maximum — narrow the period
HTTP422 CodeMETHOD_NOT_YET_AVAILABLE WhenThe imopenlines 26.700.0 update has not reached the portal yet. The response contains an error.release field set to imopenlines 26.700.0

Pagination without page drift

The method is paged with offset/limit. For a paged export, pin the upper bound of the period: set dateVoteTo to the moment the export starts so that new ratings do not shift the pages.

For the full list of system codes, see API errors.

See also