• 0
Wandesnet

URGENTE- Erros frequentes etiquetas

Question

Essa função tem como objetivo fazer download do arquivo zpl..

function downloadZPL($url, $debug = false)
{
    $client = new Client([
        'connect_timeout' => 10,
        'timeout' => 60.0,
        'debug' => $debug
    ]);

    $response = $client->request('GET', $url);
    try {
        if ($response->getStatusCode() == 200) {
            return $response->getBody()->getContents();
        }

    } catch (RequestException $e) {
        //var_dump($response->getBody()->getContents());
        $txt = json_encode(['log_error' => $e->getResponse(), 'response' => $response->getBody()->getContents(), 'url' => $url]);
        file_put_contents(storage_path() . '/logs-etiquetas/log-' . microtime(true) . '-' . auth()->user()->company_id . '.txt', $txt);
    }
    return false;
}

Erros retornados com muita  frequência:

production.ERROR: Server error: `GET https://api.mercadolibre.com/shipment_labels?shipment_ids=27868524670,27868457017,27866757597,27868446235,27868360712,27868345329,27868191844,27868249154,27868179643,27868174627,27868098891,27868011218,27868082371,27868074203,27868073897,27867944344,27866224576&response_type=zpl2&access_token=$token` resulted in a `500 Internal Server Error` response:
{"error":"rest_service_error","message":"com.mercadolibre.restclient.Response@4007d021","status":500}

 

production.ERROR: Client error: `GET https://api.mercadolibre.com/shipment_labels?shipment_ids=27868524670,27868457017,27866757597,27868446235,27868360712,27868345329,27868191844,27868249154,27868179643,27868174627,27868098891,27868011218,27868082371,27868074203,27868073897,27867944344,27866224576&response_type=zpl2&access_token=$token` resulted in a `400 Bad Request` response:
{"error":"bad_request","message":"bad_request for uri:http://internal.mercadolibre.com/shipment_labels?access_token\u003 (truncated...)

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