DocumentService
Reject Document
Rejects the document at the key owner’s active step (status ON_APPROVAL or ON_SIGN). A comment is required.
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 document is not in a workflow, the participant is not the caller’s active slot, or the comment is empty.
POST
/
developer
/
v1
/
documents
/
{document_id}
/
_reject
Reject Document
curl --request POST \
--url https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_reject \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"comment": "<string>",
"document_id": "<string>",
"participant_id": "<string>"
}
'import requests
url = "https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_reject"
payload = {
"comment": "<string>",
"document_id": "<string>",
"participant_id": "<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({comment: '<string>', document_id: '<string>', participant_id: '<string>'})
};
fetch('https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_reject', 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}/_reject",
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([
'comment' => '<string>',
'document_id' => '<string>',
'participant_id' => '<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}/_reject"
payload := strings.NewReader("{\n \"comment\": \"<string>\",\n \"document_id\": \"<string>\",\n \"participant_id\": \"<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}/_reject")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"comment\": \"<string>\",\n \"document_id\": \"<string>\",\n \"participant_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_reject")
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 \"comment\": \"<string>\",\n \"document_id\": \"<string>\",\n \"participant_id\": \"<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>"
}Авторизации
Параметры пути
Document id (UUID).
Тело
application/json
Ответ
OK
The document after the rejection.
Show child attributes
Show child attributes
⌘I
Reject Document
curl --request POST \
--url https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_reject \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"comment": "<string>",
"document_id": "<string>",
"participant_id": "<string>"
}
'import requests
url = "https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_reject"
payload = {
"comment": "<string>",
"document_id": "<string>",
"participant_id": "<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({comment: '<string>', document_id: '<string>', participant_id: '<string>'})
};
fetch('https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_reject', 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}/_reject",
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([
'comment' => '<string>',
'document_id' => '<string>',
'participant_id' => '<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}/_reject"
payload := strings.NewReader("{\n \"comment\": \"<string>\",\n \"document_id\": \"<string>\",\n \"participant_id\": \"<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}/_reject")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"comment\": \"<string>\",\n \"document_id\": \"<string>\",\n \"participant_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_reject")
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 \"comment\": \"<string>\",\n \"document_id\": \"<string>\",\n \"participant_id\": \"<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>"
}