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
id (path) number yes Section identifier
include (query) string no Related 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
success boolean Always true on success
data.id number Section identifier
data.name string Section name
data.catalogId number ID of the catalog the section belongs to
data.sectionId number Parent section ID. null for a top-level section
data.xmlId string External identifier
data.code string Section 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
404 ENTITY_NOT_FOUND A section with this id does not exist
400 INVALID_INCLUDE The requested include is not available for the section. The message lists the available ones
403 SCOPE_DENIED The key is missing the crm scope
401 MISSING_API_KEY The X-Api-Key header was not provided

Full list of common API errors — Errors.

See also