Obtener un documento
Estado, estilo aplicado y, cuando termina, los enlaces de descarga.
curl --request GET \
--url https://api.eu.doconda.com/v1/documents/{document_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.eu.doconda.com/v1/documents/{document_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.eu.doconda.com/v1/documents/{document_id}', 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://api.eu.doconda.com/v1/documents/{document_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.eu.doconda.com/v1/documents/{document_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.eu.doconda.com/v1/documents/{document_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eu.doconda.com/v1/documents/{document_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "document",
"name": "<string>",
"operation": "create",
"format": "docx",
"type": "report",
"mode": "prompt",
"sector": "<string>",
"parent_id": "<string>",
"status": "queued",
"phase": "<string>",
"pages": 0,
"style_applied": {
"font": "<string>",
"font_size": 123,
"line_spacing": 123,
"colors": {
"title": "<string>",
"headings": "<string>",
"text": "<string>",
"accent": "<string>"
},
"align": {
"title": "left",
"headings": "left",
"body": "left"
},
"margins_cm": 123,
"orientation": "portrait",
"cover_page": true,
"table_of_contents": true,
"page_numbers": true,
"header": "<string>",
"footer": "<string>"
},
"style_unsupported": [
"<string>"
],
"validation_summary": {
"errors": 0,
"warnings": 0,
"info": 0
},
"repair_summary": {
"iterations": 0,
"applied": 0,
"rejected": 0
},
"error": {
"code": "<string>",
"message": "<string>"
},
"versions": {
"engine": "<string>",
"renderer": "<string>",
"model": "<string>"
},
"metadata": {},
"store": true,
"route": {
"path": "fast",
"reason": "<string>"
},
"quality": {
"requested": "auto",
"level": "fast",
"reason": "<string>"
},
"artifact": {
"storage": "local"
},
"content_deleted_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"outputs": [
{
"id": "<string>",
"kind": "docx",
"content_type": "<string>",
"bytes": 0,
"url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"page": 0,
"width": 0,
"height": 0
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"code": "<string>",
"request_id": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"code": "<string>",
"request_id": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}Autorizaciones
Authorization: Bearer ak_eu_…. The prefix is the project's region and must match the server (api.eu / api.us).
Parámetros de ruta
Respuesta
The document.
^doc_[0-9A-HJKMNP-TV-Z]{26}$"document"The name you gave it (name when creating it).
create, review, edit, extract The file you want. docx → Word (with a PDF too), pdf → only the PDF, pptx → PowerPoint (with a PDF), xlsx → Excel (with a PDF). artifact → a web page that keeps data (in each visitor's browser, or shared by everyone), on a signed link; with store: false, a page to download (see the artifacts guide). Without it, Doconda works it out from prompt.
docx, pdf, pptx, xlsx, artifact What Doconda decided the document is. It sets the default look (a contract: serif, justified, numbered clauses; a letter: no page numbers). You don't choose it: say what you want in prompt, and the look in style.
report, letter, contract, memo, minutes, presentation, spreadsheet, artifact manual: a version someone edited by hand in the editor (POST /documents/{id}/versions).
prompt, content, manual The professional sector Doconda recognised in the request (legal, healthcare, accounting…). Its guide shapes the structure and conventions; what you say or send always wins.
The document this version was edited from.
^doc_[0-9A-HJKMNP-TV-Z]{26}$queued, running, ready, ready_with_warnings, needs_review, failed, canceled -9007199254740991 <= x <= 9007199254740991Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
false: its content is deleted 15 minutes after it finishes.
The path Doconda chose to make the file, and why. fast: the AI writes the text and Doconda lays it out (seconds). agent: an AI agent writes the program that builds the file, looks at the pages and fixes them (30 s – 2 min; any design, comments, tracked changes, formulas and charts). Doconda always chooses.
Show child attributes
Show child attributes
create and edit: the quality level asked for and the one used, which sets the price.
Show child attributes
Show child attributes
Artifacts only: where the page keeps its data.
Show child attributes
Show child attributes
When its files, request, report and events were deleted (store: false).
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$Present once finished.
Show child attributes
Show child attributes
curl --request GET \
--url https://api.eu.doconda.com/v1/documents/{document_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.eu.doconda.com/v1/documents/{document_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.eu.doconda.com/v1/documents/{document_id}', 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://api.eu.doconda.com/v1/documents/{document_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.eu.doconda.com/v1/documents/{document_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.eu.doconda.com/v1/documents/{document_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eu.doconda.com/v1/documents/{document_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "document",
"name": "<string>",
"operation": "create",
"format": "docx",
"type": "report",
"mode": "prompt",
"sector": "<string>",
"parent_id": "<string>",
"status": "queued",
"phase": "<string>",
"pages": 0,
"style_applied": {
"font": "<string>",
"font_size": 123,
"line_spacing": 123,
"colors": {
"title": "<string>",
"headings": "<string>",
"text": "<string>",
"accent": "<string>"
},
"align": {
"title": "left",
"headings": "left",
"body": "left"
},
"margins_cm": 123,
"orientation": "portrait",
"cover_page": true,
"table_of_contents": true,
"page_numbers": true,
"header": "<string>",
"footer": "<string>"
},
"style_unsupported": [
"<string>"
],
"validation_summary": {
"errors": 0,
"warnings": 0,
"info": 0
},
"repair_summary": {
"iterations": 0,
"applied": 0,
"rejected": 0
},
"error": {
"code": "<string>",
"message": "<string>"
},
"versions": {
"engine": "<string>",
"renderer": "<string>",
"model": "<string>"
},
"metadata": {},
"store": true,
"route": {
"path": "fast",
"reason": "<string>"
},
"quality": {
"requested": "auto",
"level": "fast",
"reason": "<string>"
},
"artifact": {
"storage": "local"
},
"content_deleted_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"outputs": [
{
"id": "<string>",
"kind": "docx",
"content_type": "<string>",
"bytes": 0,
"url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"page": 0,
"width": 0,
"height": 0
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"code": "<string>",
"request_id": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"code": "<string>",
"request_id": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}