### Example API Call with Access Token Source: https://developer.kontur.ru/doc/diadoc-api/authentication.html An example of how to make a GET request to the /GetMyOrganizations endpoint, including the necessary Host and Authorization headers. ```http GET /GetMyOrganizations Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} Accept: application/json ``` -------------------------------- ### HTTP Request Example Source: https://developer.kontur.ru/doc/diadoc-api/http/GetOrganizationsByInnKpp.html Example of an HTTP GET request to the GetOrganizationsByInnKpp endpoint. Ensure to replace placeholders like {{inn}}, {{kpp}}, and {{access_token}} with actual values. The Host and Authorization headers are crucial for the request. ```http GET /GetOrganizationsByInnKpp?inn={{inn}}&kpp={{kpp}} HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} Accept: application/json; charset=utf-8 ``` -------------------------------- ### GetDepartment (V2) HTTP Request Example Source: https://developer.kontur.ru/doc/diadoc-api/http/GetDepartment_V2.html Use this example to make a GET request to retrieve department data. Ensure you replace {{boxId}}, {{departmentId}}, and {{access_token}} with your actual values. ```http GET /V2/GetDepartment?boxId={{boxId}}&departmentId={{departmentId}} HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} Accept: application/json; charset=utf-8 ``` -------------------------------- ### HTTP Request Example Source: https://developer.kontur.ru/doc/diadoc-api/http/AcquireCounteragentResult.html Example of an HTTP GET request to retrieve the result of a counteragent invitation. ```http GET /V2/AcquireCounteragentResult?taskId=997818e1-9420-4f8f-857f-c86fb070d0a7 HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} ``` -------------------------------- ### HTTP Request Example Source: https://developer.kontur.ru/doc/diadoc-api/http/GetSecurityEvents.html Example of an HTTP GET request to retrieve security events. Ensure to replace {{boxId}} and {{access_token}} with actual values. ```http GET /GetSecurityEvents?boxid={{boxId}} HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} Accept: application/json; charset=utf-8 ``` -------------------------------- ### HTTP Request Example Source: https://developer.kontur.ru/doc/diadoc-api/http/GetMyCertificates.html Demonstrates how to make an HTTP GET request to the GetMyCertificates endpoint. Ensure to replace placeholders like {{boxId}} and {{access_token}} with actual values. The 'Host' and 'Authorization' headers are crucial for the request. ```http GET /GetMyCertificates?boxId={{boxId}} HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} Accept: application/json; charset=utf-8 ``` -------------------------------- ### HTTP Request Example Source: https://developer.kontur.ru/doc/diadoc-api/http/GetOrganizationsByForeignTaxpayerCode.html Demonstrates how to make a GET request to the GetOrganizationsByForeignTaxpayerCode endpoint. Ensure you replace placeholders like {{foreignTaxpayerCode}} and {{access_token}} with actual values. ```http GET /GetOrganizationsByForeignTaxpayerCode?foreignTaxpayerCode={{foreignTaxpayerCode}} HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} Accept: application/json; charset=utf-8 ``` -------------------------------- ### HTTP Request Example for GetMessage (V6) Source: https://developer.kontur.ru/doc/diadoc-api/instructions/documents/servicedocs.html This snippet shows an example HTTP GET request to the GetMessage (V6) endpoint. It includes required query parameters like boxId and messageId, and headers such as Host and Authorization. ```http GET /V6/GetMessage?boxId={{boxId}}&messageId={{messageId}} HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} Accept: application/json ``` -------------------------------- ### Get XSD Schema for a Document Source: https://developer.kontur.ru/doc/diadoc-api/http/GetContent.html Retrieves the XSD schema for a specific document. This is useful for understanding the structure and validation rules of document data. ```http GET /GetContent Host: diadoc-api.kontur.ru Accept: application/json Authorization: DiadocAuth realm="DIADOC", ... ``` -------------------------------- ### C# SDK Example for Registration Source: https://developer.kontur.ru/doc/diadoc-api/http/Register.html Example demonstrating how to use the C# SDK to register an organization, including handling certificate ownership confirmation and in-process status. ```csharp var request = new RegistrationRequest { Thumbprint = certificate.Sha1Thumbprint }; var response = api.Register(token, request); if (response.RegistrationStatus == RegistrationStatus.CertificateOwnershipProofIsRequired) { api.RegisterConfirm( token, new RegistrationConfirmRequest { Thumbprint = certificate.Sha1Thumbprint, DataToSign = response.DataToSign, Signature = Sign(response.DataToSign, certificate) }); response = api.Register(token, request); } if (response.RegistrationStatus == RegistrationStatus.RegistrationIsInProcess) { Thread.Sleep(TimeSpan.FromSeconds(5)); response = api.Register(token, request); } Console.WriteLine(string.Format("BoxId: {0}, Status: {1}", response.BoxId, response.RegistrationStatus)); ``` -------------------------------- ### HTTP GET Request Example Source: https://developer.kontur.ru/doc/diadoc-api/http/GetMessage_V6.html Example of an HTTP GET request to retrieve a message using the GetMessage V6 endpoint. Ensure you replace placeholders like {{boxId}}, {{messageId}}, {{entityId}}, and {{access_token}} with actual values. ```http GET /V6/GetMessage?boxId={{boxId}}&messageId={{messageId}}&entityId={{entityId}} HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} Accept: application/json; charset=utf-8 ``` -------------------------------- ### C# SDK Example for Fetching Employees Source: https://developer.kontur.ru/doc/diadoc-api/http/GetEmployees.html Shows how to use the C# SDK to retrieve a paginated list of employees. The loop continues until all employees are fetched or no new employees are returned. ```csharp var employees = new List(); for (var page = 1;; page++) { var employeeList = api.GetEmployees(token, boxId, page, count: 10); employees.AddRange(employeeList.Employees); Console.WriteLine("{0}/{1}", employees.Count, employeeList.TotalCount); if (employeeList.Employees.Count == 0 || employees.Count >= employeeList.TotalCount) { break; } } ``` -------------------------------- ### GET Request to GetLastEvent Source: https://developer.kontur.ru/doc/diadoc-api/http/GetLastEvent_V2.html Example of an HTTP GET request to retrieve the last event for a given box ID. Requires an access token for authorization. ```http GET /V2/GetLastEvent?boxId={{boxId}} HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} Accept: application/json; charset=utf-8 ``` -------------------------------- ### HTTP Request Example Source: https://developer.kontur.ru/doc/diadoc-api/http/AddEmployeePowerOfAttorney_V2.html Demonstrates the structure of an HTTP POST request to the AddEmployeePowerOfAttorney endpoint. ```http POST /V2/AddEmployeePowerOfAttorney?boxId={{boxId}}&userId={{userId}} HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} Accept: application/json; charset=utf-8 Content-Type: application/json ``` -------------------------------- ### Get Organization Features Response Example Source: https://developer.kontur.ru/doc/diadoc-api/instructions/organizations.html This JSON response indicates the blocking status of the organization's box and lists the enabled features. 'AllowSendEncryptedDocuments' is an example of an enabled feature. ```json { "BlockStatus": { "ManualBlockStatus": { "IsBlocked": false, "RequestedTicks": 0 }, "AutoBlockStatus": { "IsBlocked": false } }, "Features": [ "AllowSendEncryptedDocuments" ] } ``` -------------------------------- ### C# SDK Usage Example Source: https://developer.kontur.ru/doc/diadoc-api/http/GetDocflowEvents_V4.html Example of iterating through document flow events using the C# SDK. ```csharp var request = new GetDocflowEventsRequest { Filter = new TimeBasedFilter { FromTimestamp = new Timestamp(new DateTime(2024, 11, 13).Ticks), // может отсутствовать ToTimestamp = new Timestamp(new DateTime(2024, 11, 20).Ticks), // может отсутствовать }, AfterIndexKey = null }; while (true) { var response = api.Docflow.GetDocflowEvents(token, boxId, request); if (!response.Events.Any()) break; Console.Out.WriteLine("Events count: {0} (of total {1})", response.Events.Count, response.TotalCount); request.AfterIndexKey = response.Events.Last().IndexKey; } ``` -------------------------------- ### HTTP Request for ExtendedSignerDetails Source: https://developer.kontur.ru/doc/diadoc-api/http/ExtendedSignerDetailsV2_get.html Example of a GET request to retrieve extended signer details. ```http GET /V2/ExtendedSignerDetails?boxId={{boxId}}&thumbprint=ee67...fa1e1&documentTitleType=UtdSeller HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} Accept: application/json ``` -------------------------------- ### C# SDK Example for RegisterConfirm Source: https://developer.kontur.ru/doc/diadoc-api/http/RegisterConfirm.html Demonstrates using the C# SDK to register an organization and confirm certificate ownership. This snippet shows the flow of checking registration status, requesting confirmation if needed, and then completing the registration. ```csharp var request = new RegistrationRequest { Thumbprint = certificate.Sha1Thumbprint }; var response = api.Register(token, request); if (response.RegistrationStatus == RegistrationStatus.CertificateOwnershipProofIsRequired) { api.RegisterConfirm( token, new RegistrationConfirmRequest { Thumbprint = certificate.Sha1Thumbprint, DataToSign = response.DataToSign, Signature = Sign(response.DataToSign, certificate) }); response = api.Register(token, request); } if (response.RegistrationStatus == RegistrationStatus.RegistrationIsInProcess) { Thread.Sleep(TimeSpan.FromSeconds(5)); response = api.Register(token, request); } Console.WriteLine(string.Format("BoxId: {0}, Status: {1}", response.BoxId, response.RegistrationStatus)); ``` -------------------------------- ### Get Acceptance Certificate HTTP Request Source: https://developer.kontur.ru/doc/diadoc-api/instructions/documents/formal/acceptcert.html This example shows an HTTP GET request to the GetDocuments method to find an incoming acceptance certificate. Use 'XmlAcceptanceCertificate.InboundNotFinished' for filterCategory and the customer's boxId. ```http GET /V3/GetDocuments?filterCategory=XmlAcceptanceCertificate.InboundNotFinished&boxId={{boxId}} HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} Accept: application/json Content-Type: application/json charset=utf-8 ``` -------------------------------- ### HTTP Request Example Source: https://developer.kontur.ru/doc/diadoc-api/http/GetPartnerEvents.html Example of an HTTP POST request to the GetPartnerEvents endpoint. Ensure the Host and Authorization headers are correctly set. ```http POST /GetPartnerEvents HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} Accept: application/json; charset=utf-8 X-Solution-Info: SoftwareName ``` -------------------------------- ### Example HTTP Request for GenerateDocumentZip Source: https://developer.kontur.ru/doc/diadoc-api/instructions/documents/printforms.html This example shows an HTTP GET request to generate a zip archive of all files related to a document's workflow. It requires boxId, messageId, and documentId, with an option for fullDocflow. ```http GET /GenerateDocumentZip?boxId={{boxId}}&messageId={{messageId}}&documentId={{documentId}}&fullDocflow=true HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} Accept: application/json ``` -------------------------------- ### HTTP POST Request Example Source: https://developer.kontur.ru/doc/diadoc-api/http/RegisterConfirm.html Example of an HTTP POST request to the /RegisterConfirm endpoint. Ensure the Host header is set correctly and include the Authorization header for authentication. ```http POST /RegisterConfirm HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} Content-Type: application/json; charset=utf-8 ``` -------------------------------- ### HTTP Request to Get New Events Source: https://developer.kontur.ru/doc/diadoc-api/http/GetNewEvents_V8.html Example of an HTTP GET request to the /V8/GetNewEvents endpoint. Use this to retrieve a list of new events for a specified box, filtered by message type, document direction, and a limit. ```http GET /V8/GetNewEvents?boxId={{boxId}}&messageType=Letter&documentDirection=Outbound&limit=3 HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} Accept: application/json; charset=utf-8 ``` -------------------------------- ### HTTP POST Request for DssSign Source: https://developer.kontur.ru/doc/diadoc-api/http/DssSign.html This example demonstrates how to make a POST request to the DssSign endpoint, including query parameters for box ID and certificate thumbprint, and the Authorization header. ```http POST /DssSign?boxId={{boxId}}&certificateThumbprint={{certThumbprint}} HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} Content-Type: application/json; charset=utf-8 ``` -------------------------------- ### Response Body Example Source: https://developer.kontur.ru/doc/diadoc-api/http/GetOrganizationsByInnList.html Provides an example of the JSON response received from the GetOrganizationsByInnList endpoint, detailing organization information. ```json { "Organizations": [ { "Organization": { "OrgIdGuid": "42e386dc-2905-4765-9c9e-dd905ca20197", "OrgId": "42e386dc-2905-4765-9c9e-dd905ca20197", "Inn": "2572107000", "Kpp": "490901000", "FullName": "Общество с ограниченной ответственностью \"Продавцы\"", "ShortName": "ООО \"ПРОДАВЦЫ\"", "JoinedDiadocTreaty": true, "Boxes": [ { "BoxId": "ad232c42d3124675878b4a60307530a2@diadoc.ru", "BoxIdGuid": "ad232c42-d312-4675-878b-4a60307530a2", "Title": "ООО \"ПРОДАВЦЫ\"", "InvoiceFormatVersion": "v5_02", "EncryptedDocumentsAllowed": false } ], "Ogrn": "2158366672935", "FnsParticipantId": "2BM-2572107160-490901001-201910290427107624171", "Address": { "RussianAddress": { "ZipCode": "685512", "Region": "25", "City": "Тверь", "Street": "ул Ленина", "Building": "3", "Apartment": "9" }, "AddressCode": "" }, "Departments": [], "IfnsCode": "4910", "IsPilot": false, "IsActive": false, "IsTest": false, "IsBranch": false, "IsRoaming": false, "IsEmployee": false, "InvitationCount": 0, "SearchCount": 0, "Sociability": "AllOrganizations", "IsForeign": false, "HasCertificateToSign": false, "OrganizationType": "Juridical", "IsOwner": false }, "CounteragentStatus": "NotInCounteragentList", "LastEventTimestampTicks": 0 }, { "Organization": { "OrgIdGuid": "3e6bf75d-5994-4006-b7be-16eb3ff34e8c", "OrgId": "3e6bf75d-5994-4006-b7be-16eb3ff34e8c", "Inn": "0879699000", "Kpp": "500101000", "FullName": "Общество с ограниченной ответственностью \"Комфорт\"", "ShortName": "ООО \"КОМФОРТ\"", "JoinedDiadocTreaty": true, "Boxes": [ { "BoxId": "c848c38cbba24fb888303b986f3fa353@diadoc.ru", "BoxIdGuid": "c848c38c-bba2-4fb8-8830-3b986f3fa353", "Title": "ООО \"КОМФОРТ\"", "InvoiceFormatVersion": "v5_02", "EncryptedDocumentsAllowed": false } ], "Ogrn": "5110574500977", "FnsParticipantId": "2BM-0879699153-772201001-201802140845001411171", "Address": { "RussianAddress": { "ZipCode": "113780", "Region": "08", "Street": "ул Октябрьская", "Building": "9а", "Block": "7", "Apartment": "Эт 5 Пом I Ком 5" }, "AddressCode": "" }, "Departments": [], "IfnsCode": "7722", "IsPilot": false, "IsActive": false, "IsTest": false, "IsBranch": false, "IsRoaming": false, "IsEmployee": false, "InvitationCount": 0, "SearchCount": 0, "Sociability": "AllOrganizations", "IsForeign": false, "HasCertificateToSign": false, "OrganizationType": "Juridical", "IsOwner": false }, "CounteragentStatus": "NotInCounteragentList", "LastEventTimestampTicks": 0 }, { "Organization": { "OrgIdGuid": "800e19d4-8446-4cbf-95f7-466c7ead7cb4", "OrgId": "800e19d4-8446-4cbf-95f7-466c7ead7cb4", "Inn": "4417678000", "Kpp": "757645000", "FullName": "Агентство", "ShortName": "Агентство", "JoinedDiadocTreaty": true, "Boxes": [ { ``` -------------------------------- ### Get Workflows Settings HTTP Request Source: https://developer.kontur.ru/doc/diadoc-api/http/GetWorkflowsSettings.html Example of an HTTP GET request to retrieve workflow settings. Ensure to replace {{boxId}} and {{access_token}} with actual values. The 'Accept' header specifies the desired response format. ```http GET /V2/GetWorkflowsSettings?boxId={{boxId}} HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} Accept: application/json; charset=utf-8 ``` -------------------------------- ### HTTP Request Example Source: https://developer.kontur.ru/doc/diadoc-api/http/GetOrganizationsByInnList.html Shows the structure of an HTTP POST request to the GetOrganizationsByInnList endpoint. ```http POST /V2/GetOrganizationsByInnList?myBoxId={{boxId}} HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} Accept: application/json; charset=utf-8 ``` -------------------------------- ### HTTP Response Example Source: https://developer.kontur.ru/doc/diadoc-api/http/GetOrganizationsByInnKpp.html Example of a successful JSON response body from the GetOrganizationsByInnKpp endpoint. It includes a list of organizations matching the provided INN and KPP, with detailed information for each. ```json { "Organizations": [ { "OrgIdGuid": "9e255d17-f8ce-4bfa-99cf-aa2ce0f4114b", "OrgId": "9e255d17-f8ce-4bfa-99cf-aa2ce0f4114b", "Inn": "9208773000", "Kpp": "920801000", "FullName": "Общество с ограниченной ответственностью \"Предприятие\"", "ShortName": "ООО \"Предприятие\"", "JoinedDiadocTreaty": true, "Boxes": [ { "BoxId": "0ff0804922e14450b23449dad7a7762@diadoc.ru", "BoxIdGuid": "0ff08049-22e1-4450-b234-49dad7a7762", "Title": "ООО \"Предприятие\"", "InvoiceFormatVersion": "v5_02", "EncryptedDocumentsAllowed": false } ], "Ogrn": "9045162480277", "FnsParticipantId": "2BM-920801001-920801001-201910290427107624171", "Address": { "RussianAddress": { "ZipCode": "920459", "Region": "92", "City": "Вологда", "Street": "ул Речная", "Building": "3", "Apartment": "9/1" }, "AddressCode": "" }, "Departments": [], "IfnsCode": "9210", "IsPilot": false, "IsActive": false, "IsTest": false, "IsBranch": false, "IsRoaming": false, "IsEmployee": false, "InvitationCount": 0, "SearchCount": 0, "Sociability": "AllOrganizations", "IsForeign": false, "HasCertificateToSign": false, "OrganizationType": "Juridical", "IsOwner": false } ] } ``` -------------------------------- ### Get Operator Confirmation Message Response Source: https://developer.kontur.ru/doc/diadoc-api/instructions/documents/servicedocs.html This is an example of the response body for an operator confirmation. The EntityType will be 'Attachment' and AttachmentType will be 'InvoiceConfirmation'. ```json { "EntityType": "Attachment", "EntityId": "9955dccd-82fd-4412-b953-7854e102f782", "ParentEntityId": "736aa0c4-12f5-4412-bfea-1de59948b904", "Content": "lores ipsum", "AttachmentType": "InvoiceConfirmation", "FileName": "DP_PDPOL_2BM-7750370234-4012052808304878702630000000000_2BM_20150927_324c290e-f049-4906-baac-1ddcd7f3c2ff.xml", "NeedRecipientSignature": false, "SignerBoxId": "", "NotDeliveredEventId": "", "RawCreationDate": 635789700936777240, "SignerDepartmentId": "", "NeedReceipt": false, "IsApprovementSignature": false, "IsEncryptedContent": false } ``` -------------------------------- ### HTTP Request for GenerateTtGisFixationCancellationRequest Source: https://developer.kontur.ru/doc/diadoc-api/http/GenerateTtGisFixationCancellationRequest.html Example of the POST request structure including required query parameters and authorization header. ```http POST /GenerateTtGisFixationCancellationRequest?boxId={{boxId}}&messageId={{messageId}}&documentId={{documentId}} HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} Accept: application/json; charset=utf-8 ``` -------------------------------- ### HTTP Request for GetSubscriptions Source: https://developer.kontur.ru/doc/diadoc-api/http/GetSubscriptions.html Example of a GET request to retrieve subscription settings, requiring boxId and userId as query parameters. ```http GET /GetSubscriptions?boxId={{boxId}}&userId={{userId}} HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} Accept: application/json; charset=utf-8 ``` -------------------------------- ### Request and Response Body Examples Source: https://developer.kontur.ru/doc/diadoc-api/http/DetectCustomPrintForms.html JSON examples for the request body containing document IDs and the corresponding response body indicating custom print form availability. ```json { "DocumentIds" : [ { "MessageId" : "b93e4464-b14d-4c30-a8f5-b714c390d0a0", "EntityId" : "6c69e5bd-f421-4825-9f31-970182fee429" }, { "MessageId" : "f2f388b8-4a96-4ce5-bd85-23fe10131ea4", "EntityId" : "bf16d371-3b18-47dd-b5f1-5a959628d0ef" } ] } ``` ```json { "Items": [ { "DocumentId": { "EntityId": "6c69e5bd-f421-4825-9f31-970182fee429", "MessageId": "b93e4464-b14d-4c30-a8f5-b714c390d0a0" }, "HasCustomPrintForm": false }, { "DocumentId": { "EntityId": "bf16d371-3b18-47dd-b5f1-5a959628d0ef", "MessageId": "f2f388b8-4a96-4ce5-bd85-23fe10131ea4" }, "HasCustomPrintForm": true } ] } ``` -------------------------------- ### HTTP Request for GetGeneratedPrintForm Source: https://developer.kontur.ru/doc/diadoc-api/http/GetGeneratedPrintForm.html Example of an HTTP GET request to retrieve a generated print form using a specific printFormId. ```http GET /GetGeneratedPrintForm?printFormId=f68fe07d-d514-4896-9183-bdeae22d22b2 HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} ``` -------------------------------- ### C# SDK Example for Creating Employee Source: https://developer.kontur.ru/doc/diadoc-api/http/CreateEmployee.html This C# code snippet demonstrates how to use the Diadoc API SDK to create an employee. It shows the object instantiation and property mapping for credentials, position, and permissions. ```csharp var employee = api.CreateEmployee( token, boxId, new EmployeeToCreate { Credentials = new EmployeeToCreateCredentials { Certificate = new EmployeeToCreateByCertificate { Content = certificateBytes, AccessBasis = "Доверенность №39 от 21.08.2018", Email = "email@example.com" } }, Position = "Директор", Permissions = new EmployeePermissions { UserDepartmentId = "00000000-0000-0000-0000-000000000000", IsAdministrator = true, DocumentAccessLevel = DocumentAccessLevel.SelectedDepartments, SelectedDepartmentIds = { "4eef75de-44f3-4df6-8599-6c3fad74e31e" }, Actions = { new EmployeeAction { Name = "CreateDocuments", IsAllowed = true }, new EmployeeAction { Name = "DeleteRestoreDocuments", IsAllowed = true }, new EmployeeAction { Name = "SignDocuments", IsAllowed = true }, new EmployeeAction { Name = "AddResolutions", IsAllowed = true }, new EmployeeAction { Name = "RequestResolutions", IsAllowed = true }, new EmployeeAction { Name = "ManageCounteragents", IsAllowed = true } } } }); ``` -------------------------------- ### HTTP Request for GetCounteragents Source: https://developer.kontur.ru/doc/diadoc-api/http/GetCounteragents.html Example of an HTTP GET request to retrieve counteragents with specified query parameters and authorization headers. ```http GET /V3/GetCounteragents?myBoxId={{myBoxId}}&counteragentStatus=IsMyCounteragent&query=Ромашка HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} Accept: application/json; charset=utf-8 ``` -------------------------------- ### DssSign (V2) Request - GosKeySign Source: https://developer.kontur.ru/doc/diadoc-api/http/DssSign_v2.html Example HTTP request for initiating a file signing operation using GosKeySign. Note the specific constraints for GosKeySign, such as file size limits and SNILS matching. ```http POST /V2/DssSign?boxId={{boxId}} HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: DiadocAuth ddauth_api_client_id={{client_id}}, ddauth_token={{auth_token}} Content-Type: application/json; charset=utf-8 ``` ```json { "Files" : [ { "Content": { "Content" : "" }, "FileName": "fileName.xml" } ], "SignDataSource" : "GosKeySign", "GosKeyData" : { "Snils": "123-456-789 00" } } ``` ```http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "TaskId": "2fd45887-138e-4e08-aeb2-bcd55bf0dd85" } ``` -------------------------------- ### Get Invoice Receipt Message Response Source: https://developer.kontur.ru/doc/diadoc-api/instructions/documents/servicedocs.html This is an example of the response body when retrieving an invoice receipt. The EntityType will be 'Attachment' and AttachmentType will be 'InvoiceReceipt'. ```json { "EntityType": "Attachment", "EntityId": "1d7b2e96-9945-41ab-aeea-2f310382bfad", "ParentEntityId": "45d16c54-8700-4882-afaf-97678d6ed135", "Content": "lores ipsum", "AttachmentType": "InvoiceReceipt", "FileName": "DP_IZVPOL_2BM-9610384428-961001000-201510080625090688235_2BM-9653544919-965301000-201508270726013081470_20151008_6bbfab54-4e9f-4ca1-99eb-37f34880a784.xml", "NeedRecipientSignature": false, "SignerBoxId": "", "NotDeliveredEventId": "", "RawCreationDate": 635798950114653648, "SignerDepartmentId": "", "NeedReceipt": false, "IsApprovementSignature": false, "IsEncryptedContent": false } ``` -------------------------------- ### HTTP Request for POA Content Source: https://developer.kontur.ru/doc/diadoc-api/http/GetPowerOfAttorneyContent.html Example of an HTTP GET request to retrieve POA content using boxId, messageId, and entityId. ```http GET /V2/GetPowerOfAttorneyContent?myBoxId={{boxId}}&messageId={{messageId}}&entityId={{entityId}} HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} Accept: application/json; charset=utf-8 ``` -------------------------------- ### HTTP Request Example Source: https://developer.kontur.ru/doc/diadoc-api/http/PostTemplatePatch.html Example of an HTTP POST request to the PostTemplatePatch endpoint. Ensure to replace placeholders like {{boxId}}, {{templateId}}, and {{access_token}} with actual values. ```http POST /PostTemplatePatch?boxId={{boxId}}&templateId={{templateId}} HTTP/1.1 Host: diadoc-api.kontur.ru Authorization: Bearer {{access_token}} Accept: application/json; charset=utf-8 Content-Type: application/json ```