• 0

Erro 404 ao fazer download DANFE em PDF


Olá, pessoal, estou fazendo o download (DANFE) em PDF, fiz alguns testes seguindo o tutorial da documentação do ML, porém está me devolvendo o erro 404 (Página não encontrada), alguém poderia me ajudar? Obrigado!

Tentei dessa forma:

 function download_xml($user_id, $invoice_id){
        $url = "https://api.mercadolibre.com/users/$user_id/invoices/sites/MLB/documents/danfe/{$invoice_id}?access_token=$ACCESS_TOKEN";
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL,$url);
        curl_setopt($ch, CURLOPT_FAILONERROR,1);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
        curl_setopt($ch, CURLOPT_TIMEOUT, 15);
        $retValue = curl_exec($ch);
        return $retValue;


Edited by Wandesnet

Share this post

Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.