{"name":"Контур.Диадок API","vendor":"СКБ Контур","industry":"accounting","summary":"API системы электронного документооборота Контур.Диадок для обмена юридически значимыми документами между организациями. Позволяет интегрировать учётную систему (1С, ERP) с Диадоком: авторизоваться, найти свои ящики и ящики контрагентов, пригласить контрагента, отправить УПД, счёт-фактуру, акт или неформализованный документ, получать входящие события, подписывать документы титулом получателя, скачивать содержимое и печатные формы. Данные передаются в JSON (часть методов поддерживает protobuf).","docsUrl":"https://developer.kontur.ru/doc/diadoc-api/","coverage":{"included":["Аутентификация по логину и паролю, заголовок `DiadocAuth`","Свои организации и ящики, поиск организации по ИНН/КПП","Список контрагентов и приглашение к обмену","Типы документов ящика и генерация XML-титула формализованного документа","Отправка документов любых типов (`DocumentAttachments`)","Лента событий ящика для получения входящих","Список документов, содержимое сущности, печатная форма PDF","Подпись входящего документа: титул получателя через дополнение к сообщению"],"excluded":["Вход по сертификату и auth.sid, расшифровка токена (проще через SDK)","Формирование электронной подписи (CMS, КЭП) — делается на стороне клиента","Машиночитаемые доверенности (МЧД), DSS-подпись","Аннулирование, отказ в подписи, уведомления об уточнении, извещения о получении","Согласование, маршруты, подразделения, сотрудники, группы контрагентов","Шаблоны и черновики, полка документов для больших файлов, роуминг"]},"scenarios":[{"id":"voyti-i-nayti-svoy-yaschik","title":"Войти и найти свой ящик","summary":"Без авторизационного токена и идентификатора ящика (`BoxId`) не работает ни один метод.","steps":["Получи токен: POST /V3/Authenticate?type=password с JSON `{\"login\": ..., \"password\": ...}` и заголовком `Authorization: DiadocAuth ddauth_api_client_id={ключ разработчика}`.","Дальше в каждом запросе передавай `Authorization: DiadocAuth ddauth_api_client_id={ключ}, ddauth_token={токен}`.","Получи организации пользователя: GET /GetMyOrganizations.","Возьми `Organizations[].Boxes[].BoxIdGuid` — его передают в методы как `boxId`."],"code":"curl -X POST \"https://diadoc-api.kontur.ru/V3/Authenticate?type=password\" \\\n  -H \"Authorization: DiadocAuth ddauth_api_client_id=$CLIENT_ID\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"login\": \"user@example.com\", \"password\": \"secret\"}'\n\ncurl \"https://diadoc-api.kontur.ru/GetMyOrganizations\" \\\n  -H \"Authorization: DiadocAuth ddauth_api_client_id=$CLIENT_ID, ddauth_token=$TOKEN\"","language":"bash","methods":["POST /V3/Authenticate","GET /GetMyOrganizations"]},{"id":"priglasit-kontragenta-k-obmenu","title":"Пригласить контрагента к обмену","summary":"Документы можно отправлять организациям, с которыми установлены партнёрские отношения (если получатель принимает документы только от контрагентов).","steps":["Найди организацию по ИНН: GET /GetOrganizationsByInnKpp?inn=... — возьми `OrgId` и ящик.","Проверь текущий статус: GET /V3/GetCounteragents?myBoxId=...&query={ИНН} — `CurrentStatus` (`IsMyCounteragent`, `InvitesMe`, `IsInvitedByMe` и др.).","Отправь приглашение: POST /V3/AcquireCounteragent?myBoxId=... с `OrgId` или `Inn` и сообщением — в ответе `TaskId`.","Получи результат: GET /V2/AcquireCounteragentResult?taskId=... — при `204` повтори через время из заголовка `Retry-After`."],"code":"curl \"https://diadoc-api.kontur.ru/GetOrganizationsByInnKpp?inn=6663003127\" \\\n  -H \"Authorization: DiadocAuth ddauth_api_client_id=$CLIENT_ID, ddauth_token=$TOKEN\"\n\ncurl -X POST \"https://diadoc-api.kontur.ru/V3/AcquireCounteragent?myBoxId=$BOX_ID\" \\\n  -H \"Authorization: DiadocAuth ddauth_api_client_id=$CLIENT_ID, ddauth_token=$TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"Inn\": \"6663003127\", \"MessageToCounteragent\": \"Предлагаем обмениваться документами через Диадок\"}'\n\ncurl \"https://diadoc-api.kontur.ru/V2/AcquireCounteragentResult?taskId=$TASK_ID\" \\\n  -H \"Authorization: DiadocAuth ddauth_api_client_id=$CLIENT_ID, ddauth_token=$TOKEN\"","language":"bash","methods":["GET /GetOrganizationsByInnKpp","GET /V3/GetCounteragents","POST /V3/AcquireCounteragent","GET /V2/AcquireCounteragentResult"]},{"id":"otpravit-upd-ili-drugoy-formalizovannyy","title":"Отправить УПД или другой формализованный документ","summary":"Формализованный документ отправляется как XML-титул отправителя с электронной подписью.","steps":["Узнай доступные типы: GET /V3/GetDocumentTypes?boxId=... — нужны `Name` (TypeNamedId), функция и версия.","Сгенерируй XML титула: POST /GenerateTitleXml?boxId=...&documentTypeNamedId=...&documentFunction=...&documentVersion=...&titleIndex=0, в теле — упрощённый `UserDataXml` по XSD контракта.","Подпиши XML своей КЭП (CMS SignedData, DER) на стороне клиента.","Отправь: POST /V3/PostMessage с `FromBoxId`, `ToBoxId` и `DocumentAttachments[]` (`TypeNamedId`, `Function`, `Version`, `SignedContent.Content`, `SignedContent.Signature`). В ответе — `MessageId` и `Entities`.","Передавай `operationId`, чтобы повтор запроса не создал дубликат."],"code":"curl -X POST \"https://diadoc-api.kontur.ru/V3/PostMessage?operationId=$OPERATION_ID\" \\\n  -H \"Authorization: DiadocAuth ddauth_api_client_id=$CLIENT_ID, ddauth_token=$TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"FromBoxId\": \"'\"$BOX_ID\"'\",\n    \"ToBoxId\": \"'\"$COUNTERAGENT_BOX_ID\"'\",\n    \"DocumentAttachments\": [{\n      \"TypeNamedId\": \"'\"$TYPE_NAMED_ID\"'\",\n      \"Function\": \"'\"$FUNCTION\"'\",\n      \"Version\": \"'\"$VERSION\"'\",\n      \"SignedContent\": {\"Content\": \"'\"$XML_BASE64\"'\", \"Signature\": \"'\"$SIGNATURE_BASE64\"'\"}\n    }]\n  }'","language":"bash","methods":["GET /V3/GetDocumentTypes","POST /GenerateTitleXml","POST /V3/PostMessage"]},{"id":"zabirat-vhodyaschie-dokumenty","title":"Забирать входящие документы","summary":"Лента событий ящика: каждое событие содержит новое сообщение или дополнение к нему.","steps":["Вызови GET /V8/GetNewEvents?boxId=...&documentDirection=Inbound.","Обработай `Events[]`: `Message` — новые документы, `Patch` — подписи, отказы, титулы.","Сохрани `IndexKey` последнего события и передавай его в `afterIndexKey` при следующем вызове.","Содержимое документа скачай: GET /V4/GetEntityContent?boxId=...&messageId=...&entityId=...."],"code":"curl \"https://diadoc-api.kontur.ru/V8/GetNewEvents?boxId=$BOX_ID&documentDirection=Inbound&afterIndexKey=$LAST_INDEX_KEY\" \\\n  -H \"Authorization: DiadocAuth ddauth_api_client_id=$CLIENT_ID, ddauth_token=$TOKEN\"\n\ncurl \"https://diadoc-api.kontur.ru/V4/GetEntityContent?boxId=$BOX_ID&messageId=$MESSAGE_ID&entityId=$ENTITY_ID\" \\\n  -H \"Authorization: DiadocAuth ddauth_api_client_id=$CLIENT_ID, ddauth_token=$TOKEN\" -o document.xml","language":"bash","methods":["GET /V8/GetNewEvents","GET /V4/GetEntityContent"]},{"id":"podpisat-vhodyaschiy-dokument","title":"Подписать входящий документ","summary":"Для двусторонних документов (УПД, акт) получатель формирует и подписывает свой титул.","steps":["Сгенерируй титул получателя: POST /GenerateTitleXml с `titleIndex` титула получателя, `letterId` (сообщение) и `documentId` (документ отправителя).","Подпиши XML своей КЭП.","Отправь дополнение: POST /V3/PostMessagePatch с `BoxId`, `MessageId` и `RecipientTitles[]` (`ParentEntityId` — титул отправителя, `SignedContent`)."],"code":"curl -X POST \"https://diadoc-api.kontur.ru/V3/PostMessagePatch\" \\\n  -H \"Authorization: DiadocAuth ddauth_api_client_id=$CLIENT_ID, ddauth_token=$TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"BoxId\": \"'\"$BOX_ID\"'\",\n    \"MessageId\": \"'\"$MESSAGE_ID\"'\",\n    \"RecipientTitles\": [{\n      \"ParentEntityId\": \"'\"$ENTITY_ID\"'\",\n      \"SignedContent\": {\"Content\": \"'\"$XML_BASE64\"'\", \"Signature\": \"'\"$SIGNATURE_BASE64\"'\"}\n    }]\n  }'","language":"bash","methods":["POST /GenerateTitleXml","POST /V3/PostMessagePatch"]},{"id":"poluchit-pechatnuyu-formu-pdf","title":"Получить печатную форму PDF","summary":"","steps":["Вызови GET /GeneratePrintForm?boxId=...&messageId=...&documentId=....","Если тело пустое и есть заголовок `Retry-After` — повтори запрос через указанное число секунд.","Готовая форма приходит PDF-файлом."],"code":"curl -i \"https://diadoc-api.kontur.ru/GeneratePrintForm?boxId=$BOX_ID&messageId=$MESSAGE_ID&documentId=$DOCUMENT_ID\" \\\n  -H \"Authorization: DiadocAuth ddauth_api_client_id=$CLIENT_ID, ddauth_token=$TOKEN\" -o printform.pdf","language":"bash","methods":["GET /GeneratePrintForm"]}],"baseUrls":[{"label":"Боевой","url":"https://diadoc-api.kontur.ru"},{"label":"Тестовый","url":"https://diadoc-api.testkontur.ru"}],"auth":{"type":"other","description":"Нужны ключ разработчика (выдаётся по заявке на `https://www.diadoc.ru/integrations/api`) и авторизационный токен пользователя. Оба передаются в заголовке по схеме DiadocAuth:\n\nТокен выдаёт POST /V3/Authenticate: по логину и паролю (`type=password`, JSON с `login` и `password`), по сертификату (`type=certificate`, ответ расшифровывается закрытым ключом и подтверждается через /V3/AuthenticateConfirm) или по `auth.sid` (`type=sid`).","example":"Authorization: DiadocAuth ddauth_api_client_id={{client_id}}, ddauth_token={{auth_token}}"},"methods":[{"id":"POST /V3/Authenticate","title":"Аутентификация","httpMethod":"POST","path":"/V3/Authenticate","description":"В ответе — авторизационный токен (для `password`) или зашифрованная строка (для `certificate`).","params":[{"name":"type","in":"query","type":"string","required":true,"description":"password, certificate или sid"},{"name":"Authorization","in":"header","type":"string","required":true,"description":"DiadocAuth ddauth_api_client_id={ключ разработчика}"},{"name":"login","in":"body","type":"string","required":false,"description":"Логин (при type=password)"},{"name":"password","in":"body","type":"string","required":false,"description":"Пароль (при type=password)"}],"requestExample":"","responseExample":"","docsUrl":"https://developer.kontur.ru/doc/diadoc.api/method?type=post&path=%2FV3%2FAuthenticate"},{"id":"GET /GetMyOrganizations","title":"Организации пользователя","httpMethod":"GET","path":"/GetMyOrganizations","description":"`Organizations[]`: `OrgId`, `Inn`, `Kpp`, `FullName`, `ShortName`, `Ogrn`, `FnsParticipantId`, `Boxes[]` (`BoxId`, `BoxIdGuid`, `Title`), `Departments`, `IsRoaming`, `IsTest`, `Sociability`.","params":[{"name":"Authorization","in":"header","type":"string","required":true,"description":"Ключ разработчика и токен"},{"name":"autoRegister","in":"query","type":"boolean","required":false,"description":"Регистрировать в организацию из сертификата (по умолчанию true)"}],"requestExample":"","responseExample":"","docsUrl":"https://developer.kontur.ru/doc/diadoc.api/method?type=get&path=%2FGetMyOrganizations"},{"id":"GET /GetOrganizationsByInnKpp","title":"Организация по ИНН/КПП","httpMethod":"GET","path":"/GetOrganizationsByInnKpp","description":"Может вернуть несколько организаций с одинаковым ИНН и ИНН-КПП.","params":[{"name":"inn","in":"query","type":"string","required":true,"description":"ИНН"},{"name":"kpp","in":"query","type":"string","required":false,"description":"КПП; без него — ящики всех организаций с этим ИНН"},{"name":"includeRelations","in":"query","type":"boolean","required":false,"description":"Вернуть число заинтересованных контрагентов"}],"requestExample":"","responseExample":"","docsUrl":"https://developer.kontur.ru/doc/diadoc.api/method?type=get&path=%2FGetOrganizationsByInnKpp"},{"id":"GET /V3/GetCounteragents","title":"Список контрагентов","httpMethod":"GET","path":"/V3/GetCounteragents","description":"`Counteragents[]`: `IndexKey`, `Organization`, `CurrentStatus` (`IsMyCounteragent`, `InvitesMe`, `IsInvitedByMe`, `RejectsMe`, `IsRejectedByMe` …), сообщения; `TotalCount`.","params":[{"name":"myBoxId","in":"query","type":"string","required":true,"description":"Ящик организации (GUID)"},{"name":"counteragentStatus","in":"query","type":"string","required":false,"description":"Фильтр по статусу"},{"name":"query","in":"query","type":"string","required":false,"description":"Поиск по наименованию или ИНН"},{"name":"afterIndexKey","in":"query","type":"string","required":false,"description":"Ключ следующей страницы (URL-кодированный)"},{"name":"pageSize","in":"query","type":"integer","required":false,"description":"1–100, по умолчанию 100"}],"requestExample":"","responseExample":"","docsUrl":"https://developer.kontur.ru/doc/diadoc.api/method?type=get&path=%2FV3%2FGetCounteragents"},{"id":"POST /V3/AcquireCounteragent","title":"Приглашение контрагента","httpMethod":"POST","path":"/V3/AcquireCounteragent","description":"Асинхронный: возвращает `TaskId`, результат — в /V2/AcquireCounteragentResult.","params":[{"name":"myBoxId","in":"query","type":"string","required":true,"description":"Ящик, от имени которого приглашаем"},{"name":"myDepartmentId","in":"query","type":"string","required":false,"description":"Подразделение"},{"name":"OrgId","in":"body","type":"string","required":false,"description":"ID организации контрагента"},{"name":"Inn","in":"body","type":"string","required":false,"description":"ИНН контрагента"},{"name":"BoxId","in":"body","type":"string","required":false,"description":"Ящик контрагента"},{"name":"MessageToCounteragent","in":"body","type":"string","required":false,"description":"Сообщение, до 2000 символов"},{"name":"InvitationDocument","in":"body","type":"object","required":false,"description":"Файл приглашения (FileName, SignedContent, SignatureRequested)"}],"requestExample":"","responseExample":"","docsUrl":"https://developer.kontur.ru/doc/diadoc.api/method?type=post&path=%2FV3%2FAcquireCounteragent"},{"id":"GET /V2/AcquireCounteragentResult","title":"Результат приглашения","httpMethod":"GET","path":"/V2/AcquireCounteragentResult","description":"`200` — `BoxId` приглашённой организации; `204` — ещё выполняется (заголовок `Retry-After`); `409` — приглашение не удалось.","params":[{"name":"taskId","in":"query","type":"string","required":true,"description":"TaskId из AcquireCounteragent"}],"requestExample":"","responseExample":"","docsUrl":"https://developer.kontur.ru/doc/diadoc.api/method?type=get&path=%2FV2%2FAcquireCounteragentResult"},{"id":"GET /V3/GetDocumentTypes","title":"Типы документов ящика","httpMethod":"GET","path":"/V3/GetDocumentTypes","description":"`DocumentTypes[]`: `Name` (TypeNamedId), `Title`, `SupportedDocflows`, `RequiresFnsRegistration`, `Functions` (с версиями и титулами).","params":[{"name":"boxId","in":"query","type":"string","required":true,"description":"Ящик (GUID)"}],"requestExample":"","responseExample":"","docsUrl":"https://developer.kontur.ru/doc/diadoc.api/method?type=get&path=%2FV3%2FGetDocumentTypes"},{"id":"POST /GenerateTitleXml","title":"Генерация XML титула","httpMethod":"POST","path":"/GenerateTitleXml","description":"Тело — упрощённый XML `UserDataXml` по XSD-схеме контракта типа документа.","params":[{"name":"boxId","in":"query","type":"string","required":true,"description":"Ящик (GUID)"},{"name":"documentTypeNamedId","in":"query","type":"string","required":true,"description":"Тип документа из GetDocumentTypes"},{"name":"documentFunction","in":"query","type":"string","required":true,"description":"Функция документа"},{"name":"documentVersion","in":"query","type":"string","required":true,"description":"Версия документа"},{"name":"titleIndex","in":"query","type":"integer","required":true,"description":"Номер титула"},{"name":"letterId","in":"query","type":"string","required":false,"description":"Сообщение с титулом отправителя (для титула получателя)"},{"name":"documentId","in":"query","type":"string","required":false,"description":"Документ с титулом отправителя"},{"name":"editingSettingId","in":"query","type":"string","required":false,"description":"Настройка редактирования"},{"name":"disableValidation","in":"query","type":"boolean","required":false,"description":"Отключить проверку по XSD"}],"requestExample":"","responseExample":"","docsUrl":"https://developer.kontur.ru/doc/diadoc.api/method?type=post&path=%2FGenerateTitleXml"},{"id":"POST /V3/PostMessage","title":"Отправка сообщения","httpMethod":"POST","path":"/V3/PostMessage","description":"В ответе: `MessageId`, `Entities`, `FromBoxId`, `ToBoxId`, `MessageType`. Поля `Invoices`, `NonformalizedDocuments`, `Torg12Documents` и т. п. устарели — используйте `DocumentAttachments`.","params":[{"name":"operationId","in":"query","type":"string","required":false,"description":"ID операции для идемпотентности"},{"name":"FromBoxId","in":"body","type":"string","required":true,"description":"Ящик отправителя"},{"name":"ToBoxId","in":"body","type":"string","required":true,"description":"Ящик получателя"},{"name":"DocumentAttachments[].TypeNamedId","in":"body","type":"string","required":true,"description":"Тип документа"},{"name":"DocumentAttachments[].Function","in":"body","type":"string","required":false,"description":"Функция документа"},{"name":"DocumentAttachments[].Version","in":"body","type":"string","required":false,"description":"Версия документа"},{"name":"DocumentAttachments[].SignedContent.Content","in":"body","type":"string","required":true,"description":"Содержимое (base64)"},{"name":"DocumentAttachments[].SignedContent.Signature","in":"body","type":"string","required":false,"description":"Подпись CMS SignedData в DER (base64)"},{"name":"DocumentAttachments[].Metadata","in":"body","type":"array","required":false,"description":"Метаданные (номер, дата и т. п.)"},{"name":"DocumentAttachments[].NeedRecipientSignature","in":"body","type":"boolean","required":false,"description":"Нужна подпись получателя"},{"name":"DocumentAttachments[].CustomDocumentId","in":"body","type":"string","required":false,"description":"ID во внешней системе"},{"name":"DocumentAttachments[].Comment","in":"body","type":"string","required":false,"description":"Комментарий, до 5000 символов"},{"name":"ToDepartmentId","in":"body","type":"string","required":false,"description":"Подразделение получателя"},{"name":"IsDraft","in":"body","type":"boolean","required":false,"description":"Сохранить черновиком"},{"name":"DelaySend","in":"body","type":"boolean","required":false,"description":"Сохранить без отправки"}],"requestExample":"","responseExample":"","docsUrl":"https://developer.kontur.ru/doc/diadoc.api/method?type=post&path=%2FV3%2FPostMessage"},{"id":"POST /V3/PostMessagePatch","title":"Дополнение к сообщению","httpMethod":"POST","path":"/V3/PostMessagePatch","description":"Подписи, титулы получателя, извещения, отказы, аннулирование, согласование.","params":[{"name":"operationId","in":"query","type":"string","required":false,"description":"ID операции для идемпотентности"},{"name":"BoxId","in":"body","type":"string","required":true,"description":"Ящик с исходным сообщением"},{"name":"MessageId","in":"body","type":"string","required":true,"description":"Исходное сообщение"},{"name":"RecipientTitles[].ParentEntityId","in":"body","type":"string","required":false,"description":"Титул отправителя, к которому относится титул получателя"},{"name":"RecipientTitles[].SignedContent","in":"body","type":"object","required":false,"description":"Титул получателя и подпись"},{"name":"Signatures","in":"body","type":"array","required":false,"description":"Подписи под документами (ParentEntityId, Signature)"},{"name":"XmlSignatureRejections","in":"body","type":"array","required":false,"description":"Отказы в подписи"},{"name":"RevocationRequests","in":"body","type":"array","required":false,"description":"Предложения об аннулировании"}],"requestExample":"","responseExample":"","docsUrl":"https://developer.kontur.ru/doc/diadoc.api/method?type=post&path=%2FV3%2FPostMessagePatch"},{"id":"GET /V8/GetNewEvents","title":"Лента событий ящика","httpMethod":"GET","path":"/V8/GetNewEvents","description":"`Events[]`: `EventId`, `Message`, `Patch`, `IndexKey`; `TotalCount`.","params":[{"name":"boxId","in":"query","type":"string","required":true,"description":"Ящик (GUID)"},{"name":"afterIndexKey","in":"query","type":"string","required":false,"description":"Ключ последнего полученного события"},{"name":"documentDirection","in":"query","type":"array","required":false,"description":"Inbound, Outbound и др., через запятую"},{"name":"messageType","in":"query","type":"array","required":false,"description":"Тип сообщения, например Draft"},{"name":"typeNamedId","in":"query","type":"array","required":false,"description":"Типы документов"},{"name":"counteragentBoxId","in":"query","type":"string","required":false,"description":"Ящик контрагента"},{"name":"timestampFromTicks","in":"query","type":"string","required":false,"description":"Начало периода (тики от 01.01.0001)"},{"name":"timestampToTicks","in":"query","type":"string","required":false,"description":"Конец периода"},{"name":"orderBy","in":"query","type":"string","required":false,"description":"Ascending (по умолчанию) или Descending"},{"name":"limit","in":"query","type":"integer","required":false,"description":"Элементов на странице"}],"requestExample":"","responseExample":"","docsUrl":"https://developer.kontur.ru/doc/diadoc.api/method?type=get&path=%2FV8%2FGetNewEvents"},{"id":"GET /V3/GetDocuments","title":"Список документов","httpMethod":"GET","path":"/V3/GetDocuments","description":"Без содержимого. `Documents[]`: `MessageId`, `EntityId`, `TypeNamedId`, `Title`, `DocumentDirection`, `CounteragentBoxId`, `Metadata`, `DocflowStatus`, `IndexKey`; `HasMoreResults`.","params":[{"name":"boxId","in":"query","type":"string","required":true,"description":"Ящик (GUID)"},{"name":"filterCategory","in":"query","type":"string","required":true,"description":"Категория фильтра (тип и статус документа, см. документацию метода)"},{"name":"counteragentBoxId","in":"query","type":"string","required":false,"description":"Ящик контрагента"},{"name":"documentNumber","in":"query","type":"string","required":false,"description":"Номер первичного документа"},{"name":"fromDocumentDate","in":"query","type":"string","required":false,"description":"Дата документа с, ДД.ММ.ГГГГ"},{"name":"toDocumentDate","in":"query","type":"string","required":false,"description":"Дата документа по"},{"name":"timestampFromTicks","in":"query","type":"integer","required":false,"description":"Начало периода (тики)"},{"name":"timestampToTicks","in":"query","type":"integer","required":false,"description":"Конец периода"},{"name":"afterIndexKey","in":"query","type":"string","required":false,"description":"Ключ следующей страницы"},{"name":"sortDirection","in":"query","type":"string","required":false,"description":"Ascending или Descending"},{"name":"count","in":"query","type":"integer","required":false,"description":"Элементов на странице"}],"requestExample":"","responseExample":"","docsUrl":"https://developer.kontur.ru/doc/diadoc.api/method?type=get&path=%2FV3%2FGetDocuments"},{"id":"GET /V4/GetEntityContent","title":"Содержимое сущности","httpMethod":"GET","path":"/V4/GetEntityContent","description":"Возвращает файл документа, титула или подписи.","params":[{"name":"boxId","in":"query","type":"string","required":true,"description":"Ящик (GUID)"},{"name":"messageId","in":"query","type":"string","required":true,"description":"Сообщение"},{"name":"entityId","in":"query","type":"string","required":true,"description":"Сущность в сообщении"}],"requestExample":"","responseExample":"","docsUrl":"https://developer.kontur.ru/doc/diadoc.api/method?type=get&path=%2FV4%2FGetEntityContent"},{"id":"GET /GeneratePrintForm","title":"Печатная форма","httpMethod":"GET","path":"/GeneratePrintForm","description":"PDF; если форма ещё готовится — `200` с пустым телом и заголовком `Retry-After`.","params":[{"name":"boxId","in":"query","type":"string","required":true,"description":"Ящик (GUID)"},{"name":"messageId","in":"query","type":"string","required":true,"description":"Сообщение"},{"name":"documentId","in":"query","type":"string","required":true,"description":"Документ в сообщении"}],"requestExample":"","responseExample":"","docsUrl":"https://developer.kontur.ru/doc/diadoc.api/method?type=get&path=%2FGeneratePrintForm"}],"codeExamples":[],"errors":[{"code":"400","description":"Неверный формат данных или нет обязательных параметров"},{"code":"401","description":"Нет заголовка Authorization или неверные авторизационные данные / ключ разработчика"},{"code":"402","description":"У ящика закончилась подписка на API"},{"code":"403","description":"Доступ к ящику запрещён или организация ликвидирована"},{"code":"404","description":"Документы или объекты не найдены"},{"code":"405","description":"Неподходящий HTTP-метод"},{"code":"409","description":"Дубликат сообщения, запрет приёма документов (Sociability) или конфликт операции"},{"code":"500","description":"Непредвиденная ошибка сервера"}],"limits":"- `GetCounteragents`: до 100 записей на страницу.\n- `GetDocuments`: если найдено больше 1000 документов, `HasMoreResults = true` — продолжайте по `afterIndexKey`.\n- Комментарий к документу — до 5000 символов, сообщение контрагенту — до 2000.","gotchas":["В методы передавайте `BoxIdGuid` из `GetMyOrganizations` (GUID).","Электронная подпись (CMS SignedData в DER) формируется на стороне клиента; для работы с сертификатами и подписью Контур рекомендует SDK.","Время в API — тики (100-наносекундные интервалы от 00:00:00 01.01.0001).","Асинхронные методы (AcquireCounteragent, генерация печатных форм) отвечают `204` или пустым телом с `Retry-After`.","`operationId` защищает от повторной отправки: при успешном вызове с тем же ID все следующие вернут тот же результат.","Документы с тестовыми ящиками помечаются `IsTest` и не имеют юридической силы.","Устаревшие поля сообщения (`Invoices`, `Torg12Documents`, `UniversalTransferDocumentSellerTitles` и др.) заменены универсальными `DocumentAttachments` и `RecipientTitles`."],"slug":"diadoc","version":1,"updatedAt":"2026-10-25T06:02:49.567Z","sources":[{"title":"Diadoc API — справочник методов","url":"https://developer.kontur.ru/doc/diadoc.api","kind":"research","addedAt":"2026-10-25T06:02:30.979Z"},{"title":"Документация Диадок API","url":"https://developer.kontur.ru/doc/diadoc-api/","kind":"research","addedAt":"2026-10-25T06:02:30.979Z"},{"title":"Быстрый старт","url":"https://developer.kontur.ru/doc/diadoc-api/howtostart/quickstart.html","kind":"research","addedAt":"2026-10-25T06:02:30.979Z"},{"title":"Авторизация","url":"https://developer.kontur.ru/doc/diadoc-api/Authorization.html","kind":"research","addedAt":"2026-10-25T06:02:30.979Z"},{"title":"Варианты интеграции и SDK","url":"https://developer.kontur.ru/doc/diadoc-api/howtostart/integrationChoise.html","kind":"research","addedAt":"2026-10-25T06:02:30.979Z"},{"title":"Документооборот","url":"https://developer.kontur.ru/doc/diadoc-api/docflows/index.html","kind":"research","addedAt":"2026-10-25T06:02:30.979Z"},{"title":"Вставленный текст","url":"","kind":"import","addedAt":"2026-10-25T06:02:30.979Z"}],"logoUrl":null}