Replies: 2 comments
-
Hi @isminllah! I'm Dosu and I’m helping the docling team. The Docling API expects authentication via an API key provided in the request header, specifically as $response = $client->request('POST', 'convert/file', [
'headers' => [
'accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY_HERE', // replace with your actual key
],
'multipart' => $multipart,
]); Make sure your API key matches what is configured on the Docling server. This header is required for authentication and is enforced by the API logic source. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
RESOLVED: i added the row for the api key on the docker-compose configuration: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
i'm trying to use docling via api from a webapp.
public function actionConvert()
{
$requestId = null;
$result = null;
$helper = new DoclingHelper();
REQUEST URI: http://docling_service:5001/v1/convert/file
REQUEST HEADERS: Array
(
[Content-Length] => Array
(
[0] => 8190
)
)
REQUEST BODY: --d7f3749ed18baa34d3bd67bbb1d646463ce7e5d8
Content-Disposition: form-data; name="auth"
Content-Length: 6
Hello!
--d7f3749ed18baa34d3bd67bbb1d646463ce7e5d8
Content-Disposition: form-data; name="ocr_engine"
Content-Length: 7
easyocr
--d7f3749ed18baa34d3bd67bbb1d646463ce7e5d8
Content-Disposition: form-data; name="pdf_backend"
Content-Length: 10
dlparse_v2
--d7f3749ed18baa34d3bd67bbb1d646463ce7e5d8
Content-Disposition: form-data; name="from_formats"
Content-Length: 3
pdf
--d7f3749ed18baa34d3bd67bbb1d646463ce7e5d8
Content-Disposition: form-data; name="force_ocr"
Content-Length: 5
false
--d7f3749ed18baa34d3bd67bbb1d646463ce7e5d8
Content-Disposition: form-data; name="image_export_mode"
Content-Length: 8
embedded
--d7f3749ed18baa34d3bd67bbb1d646463ce7e5d8
Content-Disposition: form-data; name="ocr_lang"
Content-Length: 2
en
--d7f3749ed18baa34d3bd67bbb1d646463ce7e5d8
Content-Disposition: form-data; name="ocr_lang"
Content-Length: 2
pl
--d7f3749ed18baa34d3bd67bbb1d646463ce7e5d8
Content-Disposition: form-data; name="table_mode"
Content-Length: 4
fast
--d7f3749ed18baa34d3bd67bbb1d646463ce7e5d8
Content-Type: application/xlsx
Content-Disposition: form-data; name="files"; filename="ai_export_100.xlsx"
Content-Length: 6369 it gets the file but RESPONSE STATUS: 401
RESPONSE BODY: {"detail":"Unauthorized"}.
I tried converting from the shell using curl and it works, the only problem is here, i think the problem is that docling needs an api key but i couldn't find anything about.
Beta Was this translation helpful? Give feedback.
All reactions