edenai-apis icon indicating copy to clipboard operation
edenai-apis copied to clipboard

OCR endpoint not working

Open drazenmatic opened this issue 8 months ago • 1 comments

Endpoint for ocr is not working.

It is throwing a validation error message about provider not being set, while within guzzle it is clearly being set and passed.

Your live preview cannot test when header is set to 'Content-Type' => 'multipart/form-data;' https://docs.edenai.co/reference/ocr_ocr_create

$client = new \GuzzleHttp\Client();

$response = $client->post('https://api.edenai.run/v2/ocr/ocr', [
    'multipart' => [
        [
            'name' => 'providers',
            'contents' => 'api4ai'
        ]
    ],
    'headers' => [
        'Authorization' => 'Bearer ' . $this->token,
        'Content-Type' => 'multipart/form-data;'
    ]
])

Response

 Client error: `POST https://api.edenai.run/v2/ocr/ocr` resulted in a `400 Bad Request` response:
    {"error":{"type":"Invalid request","message":{"providers":["Please enter the name of the provider(s)"]}}}

drazenmatic avatar Nov 06 '23 19:11 drazenmatic