For AI agents: markdown of this page — /docs-content-en/entities/product-sections/get.md documentation index — /llms.txt

Get section

GET /v1/product-sections/:id

Returns a single product catalog section by identifier.

Parameters

Parameter Type Required Description
Parameterid (path) Typenumber Requiredyes DescriptionSection identifier
Parameterinclude (query) Typestring Requiredno DescriptionRelated data: catalog, parentSection. See the "Related data" section below

Examples

curl — personal key

Terminal
curl "https://vibecode.bitrix24.com/v1/product-sections/31" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl "https://vibecode.bitrix24.com/v1/product-sections/31" \
  -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/product-sections/31', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

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

JavaScript — OAuth application

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

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

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typeobject DescriptionProduct catalog section
Fielddata.id Typenumber DescriptionSection identifier
Fielddata.name Typestring DescriptionSection name
Fielddata.catalogId Typenumber DescriptionID of the catalog the section belongs to. List: GET /v1/catalogs
Fielddata.sectionId Typenumber DescriptionParent section ID. null for a top-level section. List: GET /v1/product-sections
Fielddata.xmlId Typestring DescriptionExternal identifier
Fielddata.code Typestring DescriptionSection symbolic code

To retrieve related records together with the section, use the include parameter in the GET request:

GET /v1/product-sections/33?include=catalog,parentSection

Available includes: catalog — the product catalog the section belongs to, and parentSection — the parent section. The catalog include reads catalogs, so the key needs the catalog scope. For a top-level section, parentSection comes back as null. The result is in the _included field:

JSON
{
  "success": true,
  "data": {
    "id": 33,
    "name": "Footwear",
    "catalogId": 25,
    "sectionId": 31,
    "_included": {
      "catalog": {
        "id": 25,
        "iblockId": 25,
        "iblockTypeId": "CRM_PRODUCT_CATALOG",
        "name": "CRM product catalog"
      },
      "parentSection": {
        "id": 31,
        "name": "Clothing",
        "catalogId": 25,
        "sectionId": null,
        "code": "clothes"
      }
    }
  }
}

More on includes: Related data.

Response example

JSON
{
  "success": true,
  "data": {
    "id": 31,
    "name": "Clothing",
    "catalogId": 25,
    "sectionId": null,
    "xmlId": "666",
    "code": "clothes"
  }
}

Error response example

404 — section not found:

JSON
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Product section is not found."
  }
}

Errors

HTTP Code Description
HTTP404 CodeENTITY_NOT_FOUND DescriptionA section with this id does not exist
HTTP400 CodeINVALID_INCLUDE DescriptionThe requested include is not available for the section. The message lists the available ones
HTTP403 CodeSCOPE_DENIED DescriptionThe key is missing the crm scope
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header was not provided

Full list of common API errors — Errors.

See also