CameleonPDF

FREEMIUM
By mare | Updated 25 days ago | Video, Images
Health Check

N/A

Back to All Discussions

{"message":"Endpoint\/pdf2html\/ does not exist"}

Rapid account: Djrasmusp
djrasmusp
4 years ago

When using the api, I get this error ? what im i doing wrong ?

Rapid account: Djrasmusp
djrasmusp Commented 4 years ago

Heres my code

$filename = $_FILES['pdf']['tmp_name'];

        if(!is_readable($filename)){
            print('ERROR: file does not exist or is not readalbe');
                return;
        }
        $curl = curl_init();

        $cfile = curl_file_create($filename, 'application/pdf');

        curl_setopt_array($curl, array(
            CURLOPT_URL => "https://cameleonpdf.p.rapidapi.com/pdf2html/.",
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_FOLLOWLOCATION => true,
            CURLOPT_ENCODING => "",
            CURLOPT_MAXREDIRS => 10,
            CURLOPT_TIMEOUT => 30,
            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
            CURLOPT_CUSTOMREQUEST => "POST",
            CURLOPT_POSTFIELDS => array('PDF' => $cfile),
            CURLOPT_HTTPHEADER => array(
                "content-type: application/pdf",
                "x-rapidapi-host: cameleonpdf.p.rapidapi.com",
                "x-rapidapi-key: MY_KEY_API"
            ),
        ));

        $response = curl_exec($curl);
        $err = curl_error($curl);

        curl_close($curl);

        if ($err) {
            echo "cURL Error #:" . $err;
        } else {
            echo $response;
        }
Rapid account: Feelmare
feelmare Commented 4 years ago

Hi, I tested it right now.
On my side, api is workingโ€ฆ
How did you call the api?
Thank you.

BR
Leon

Join in the discussion - add comment below:

Login / Signup to post new comments