• 0
Wandesnet

Erro 404 ao fazer download DANFE em PDF

Question

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);
        curl_close($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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now