Skip to content

List Knowledge Entries (Query by Condition)

About 818 wordsAbout 3 min

2026-09-14

Description

Queries knowledge entries with pagination in the standard object-query manner: the query DSL (search_query_info) supports filtering, sorting and field projection over fields such as title, folder, publish status and update time.

This API is the platform standard object-query API; the object is specified via dataObjectApiName, with a fixed value of ServiceKnowledgeObj.

Request Specification

HTTP Method: POST + application/json

Request Path: https://${Cloud Domain}/cgi/crm/v2/data/query?thirdTraceId=${Random String}

Request Headers: Refer to Common Parameters

Request Parameters

ParameterTypeRequiredDescription
returnTotalNumIntNoTotal count type: 1 exact total, 2 estimated total, 3 no total (faster); when omitted the platform default applies — pass explicitly as needed
includeNullBooleanNoWhether to include null fields; false omits them, true returns them; defaults to false
dataMapYesData
  dataObjectApiNameStringYesObject apiName, fixed value ServiceKnowledgeObj
  search_query_infoMapYesQuery Condition Guide
    limitIntYesPage size (max 100)
    offsetIntNoOffset, starting at 0; defaults to 0 when omitted
    filtersListNoList of filter conditions
      field_nameStringYesapiName of the filtered field
      field_valuesList[String]YesField values
      operatorStringYesOperator; see the operator table below
    ordersListNoSort conditions
      fieldNameStringYesField apiName
      isAscBooleanNoWhether ascending; defaults to false (descending) when omitted
    fieldProjectionList[String]YesReturned field list; values are field apiNames

operator parameters

Query conditions from the object list page can be reused directly; see How to obtain list query conditions

ParameterMeaningNotesParameterMeaningNotes
EQequalsNnot equalsmatches null values too
GTgreater thanGTEgreater than or equal to
LTless thanLTEless than or equal to
LIKEcontainsNLIKEdoes not contain
ISis nullISNis not null
INbelongs toNINdoes not belong to
BETWEENbetweenNBETWEENnot between
STARTWITHstarts withENDWITHends with
HASANYOFhas overlapNHASANYOFno overlap

Common filter recipes for knowledge entries

ScenarioFilter
Entries in a given folderfield_name=category, operator=IN, field_values = folder code list
A folder and all its sub-foldersExpand sub-folders level by level via List Visible Knowledge Folders using hasChildren, then IN-filter all codes together (category matches the folder itself only; sub-folders are not included automatically)
Title keyword searchfield_name=title, operator=LIKE, field_values = keyword
Published entries onlyfield_name=public_status, operator=EQ, field_values=["1"]; see Publish Knowledge Entry for status values
Update time rangefield_name=last_modified_time, operator=BETWEEN, field_values = start/end millisecond timestamps

Request Example

{
  "returnTotalNum": 1,
  "data": {
    "dataObjectApiName": "ServiceKnowledgeObj",
    "search_query_info": {
      "offset": 0,
      "limit": 20,
      "orders": [
        { "fieldName": "last_modified_time", "isAsc": false }
      ],
      "fieldProjection": ["_id", "title", "category", "summary", "public_status", "content_type", "last_modified_time"],
      "filters": [
        { "field_name": "category", "operator": "IN", "field_values": ["16", "17"] },
        { "field_name": "public_status", "operator": "EQ", "field_values": ["1"] }
      ]
    }
  }
}

Response Parameters

ParameterTypeDescription
traceIdstringUnique request ID
errorDescriptionstringError description
errorMessagestringError message
errorCodeIntError Codes
dataMapResponse data
  totalIntTotal number of matching entries (returned when returnTotalNum is 1/2)
  dataListArrayKnowledge entries of the current page; the fields are determined by fieldProjection
  dataList[]._idStringKnowledge entry ID
  dataList[].titleStringTitle
  dataList[].categoryStringCode of the owning knowledge folder
  dataList[].summaryStringSummary
  dataList[].public_statusStringPublish status
  dataList[].content_typeStringContent type
  dataList[].last_modified_timeLongLast update time, in milliseconds

Response Example

{
  "traceId": "E-O.fktest4234.1000-20260914105000-xxxxxx",
  "errorDescription": "success",
  "errorMessage": "OK",
  "errorCode": 0,
  "data": {
    "total": 1,
    "dataList": [
      {
        "_id": "68c1a0f0abcd0001",
        "title": "Device Installation Guide",
        "category": "16",
        "summary": "Standard installation steps",
        "public_status": "1",
        "content_type": "rich_text",
        "last_modified_time": 1757772000000
      }
    ]
  }
}

Notes

  • This API exposes the query DSL directly; field names used in filters/sorting/projection are field apiNames. Obtain the field list via the object description; refer to Parameter Filling Guide.
  • The category filter matches the folder itself only and does not include sub-folders; to query a folder together with its sub-folders, expand the sub-folder codes first and use IN.
  • Sorting must be specified explicitly via orders (e.g. last_modified_time descending); the default order is not guaranteed.
  • Only non-invalidated data within the current user's permission scope is returned; invalidated (recycled) data is excluded by default.
  • A field whose value is empty is omitted from the response (pass includeNull=true to keep null fields).
  • Beware of deep pagination when combining offset and limit.
  • Do not use the message field in the response for logical judgment, as errorMessage may change.