DocumentService
Sign Document
Applies a signature on behalf of the key’s owner for one of their active signing slots. Signing is NOT performed server-side: the caller must supply a valid base64 CMS/ЭЦП signature that they produced with their own key (NCALayer or eGov Mobile). The server validates it and records it through the signing workflow.
Required scope: documents:write
Error Codes:
- DEVELOPER.SCOPE_INSUFFICIENT: The key lacks the documents:write scope.
- DOCUMENT_NOT_FOUND: No document with that id is accessible to the key.
- INVALID_ARGUMENT: The signature is malformed, or the participant is not an active signing slot of the key owner.
POST
/
developer
/
v1
/
documents
/
{document_id}
/
_sign
Sign Document
curl --request POST \
--url https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_sign \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"document_id": "<string>",
"participant_id": "<string>",
"signature": "<string>"
}
'import requests
url = "https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_sign"
payload = {
"document_id": "<string>",
"participant_id": "<string>",
"signature": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({document_id: '<string>', participant_id: '<string>', signature: '<string>'})
};
fetch('https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_sign', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_sign",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'document_id' => '<string>',
'participant_id' => '<string>',
'signature' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_sign"
payload := strings.NewReader("{\n \"document_id\": \"<string>\",\n \"participant_id\": \"<string>\",\n \"signature\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_sign")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"document_id\": \"<string>\",\n \"participant_id\": \"<string>\",\n \"signature\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_sign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"document_id\": \"<string>\",\n \"participant_id\": \"<string>\",\n \"signature\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"document": {
"completed_at": "2023-11-07T05:31:56Z",
"create_time": "2023-11-07T05:31:56Z",
"date": "<string>",
"department_id": "<string>",
"files": [
{
"file_id": "<string>",
"file_type": "FILE_TYPE_UNSPECIFIED"
}
],
"id": "<string>",
"initiator_employee_id": "<string>",
"number": "<string>",
"organization_id": "<string>",
"route": {
"active": true,
"id": "<string>",
"status": "ROUTE_STATUS_UNSPECIFIED",
"steps": [
{
"id": "<string>",
"index": 123,
"participants": [
{
"employee_id": "<string>",
"id": "<string>",
"key_type": "<string>",
"status": "PARTICIPANT_STATUS_UNSPECIFIED"
}
],
"rule": "STEP_RULE_UNSPECIFIED",
"status": "STEP_STATUS_UNSPECIFIED",
"step_type": "STEP_TYPE_UNSPECIFIED"
}
]
},
"status": "DOCUMENT_STATUS_UNSPECIFIED",
"subject_employee_ids": [
"<string>"
],
"title": "<string>",
"type_id": "<string>",
"update_time": "2023-11-07T05:31:56Z"
}
}{
"code": 123,
"details": [
{
"@type": "<string>"
}
],
"message": "<string>"
}Authorizations
Path Parameters
Document id (UUID).
Body
application/json
Document id (UUID).
The active signing participant slot of the key owner (from the document's route).
The tool the signature was produced with.
Available options:
SIGN_METHOD_UNSPECIFIED, SIGN_METHOD_NCALAYER, SIGN_METHOD_EGOV_MOBILE Base64-encoded CMS/ЭЦП signature produced client-side with the owner's key.
Response
OK
The document after the signature was recorded.
Show child attributes
Show child attributes
⌘I
Sign Document
curl --request POST \
--url https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_sign \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"document_id": "<string>",
"participant_id": "<string>",
"signature": "<string>"
}
'import requests
url = "https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_sign"
payload = {
"document_id": "<string>",
"participant_id": "<string>",
"signature": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({document_id: '<string>', participant_id: '<string>', signature: '<string>'})
};
fetch('https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_sign', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_sign",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'document_id' => '<string>',
'participant_id' => '<string>',
'signature' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_sign"
payload := strings.NewReader("{\n \"document_id\": \"<string>\",\n \"participant_id\": \"<string>\",\n \"signature\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_sign")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"document_id\": \"<string>\",\n \"participant_id\": \"<string>\",\n \"signature\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_sign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"document_id\": \"<string>\",\n \"participant_id\": \"<string>\",\n \"signature\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"document": {
"completed_at": "2023-11-07T05:31:56Z",
"create_time": "2023-11-07T05:31:56Z",
"date": "<string>",
"department_id": "<string>",
"files": [
{
"file_id": "<string>",
"file_type": "FILE_TYPE_UNSPECIFIED"
}
],
"id": "<string>",
"initiator_employee_id": "<string>",
"number": "<string>",
"organization_id": "<string>",
"route": {
"active": true,
"id": "<string>",
"status": "ROUTE_STATUS_UNSPECIFIED",
"steps": [
{
"id": "<string>",
"index": 123,
"participants": [
{
"employee_id": "<string>",
"id": "<string>",
"key_type": "<string>",
"status": "PARTICIPANT_STATUS_UNSPECIFIED"
}
],
"rule": "STEP_RULE_UNSPECIFIED",
"status": "STEP_STATUS_UNSPECIFIED",
"step_type": "STEP_TYPE_UNSPECIFIED"
}
]
},
"status": "DOCUMENT_STATUS_UNSPECIFIED",
"subject_employee_ids": [
"<string>"
],
"title": "<string>",
"type_id": "<string>",
"update_time": "2023-11-07T05:31:56Z"
}
}{
"code": 123,
"details": [
{
"@type": "<string>"
}
],
"message": "<string>"
}