#Documents
Entity: document | Scope: documentgenerator | Base path: /v1/documents
SPA entity (camelCase field names) — field names pass through without transformation.
#Operations
| Method | Path | Description | Bitrix24 Method |
|---|---|---|---|
GET |
/v1/documents |
List all (with filter, sort, pagination) | documentgenerator.document.list |
GET |
/v1/documents/:id |
Get by ID | documentgenerator.document.get |
POST |
/v1/documents |
Create new | documentgenerator.document.add |
PATCH |
/v1/documents/:id |
Update by ID | documentgenerator.document.update |
DELETE |
/v1/documents/:id |
Delete by ID | documentgenerator.document.delete |
GET |
/v1/documents/fields |
Get available fields | documentgenerator.document.getfields |
#Fields
| API Name | Bitrix24 Name | Type | Readonly | Description |
|---|---|---|---|---|
id |
id |
number | yes | Идентификатор записи |
title |
title |
string | ||
number |
number |
string | ||
templateId |
templateId |
number | ||
createTime |
createTime |
datetime | yes | |
updateTime |
updateTime |
datetime | yes | |
values |
values |
string | ||
fileId |
fileId |
number | ||
pdfId |
pdfId |
number | ||
imageId |
imageId |
number | ||
stampsEnabled |
stampsEnabled |
boolean |
#Examples
#List
curl -X GET '/v1/documents?limit=10' \
-H 'X-Api-Key: YOUR_KEY'
#Get by ID
curl -X GET '/v1/documents/123' \
-H 'X-Api-Key: YOUR_KEY'
#Create
curl -X POST '/v1/documents' \
-H 'X-Api-Key: YOUR_KEY' \
-H 'Content-Type: application/json' \
-d '{"title":"value","number":"value","templateId":1}'
#Update
curl -X PATCH '/v1/documents/123' \
-H 'X-Api-Key: YOUR_KEY' \
-H 'Content-Type: application/json' \
-d '{"title":"updated"}'
#Delete
curl -X DELETE '/v1/documents/123' \
-H 'X-Api-Key: YOUR_KEY'
#Batch
curl -X POST '/v1/batch' \
-H 'X-Api-Key: YOUR_KEY' \
-H 'Content-Type: application/json' \
-d '{"calls":[{"entity":"documents","action":"list","params":{"limit":5}}]}'