["error"]=> string(28) "unexpected end of JSON input" ["sso_status"]=> int(401)

hey CCP
i get some error from ESI since 10. july after downtime.
its not each time and very random

i allways get the message [“error”]=> string(28) “unexpected end of JSON input” [“sso_status”]=> int(401)
if i retry the request it works and stucks after some more requests

i know there is no request limit per second but i guess i get a lesser amount of errors if i use a delay between each request

    $ch = curl_init();
    $lookup_url="https://esi.evetech.net/latest/characters/" . $char_id . "/skillqueue/?datasource=tranquility&token=" . $auth_token;
    curl_setopt($ch, CURLOPT_URL, $lookup_url);
    curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
    $result = curl_exec($ch);
    curl_close($ch);
    if ($result===false) {
        echo(__FUNCTION__ . 'fail ');
        var_dump($result);
    }
    $result = json_decode($result);  
    if ( isset($result->error ) ) {  var_dump($result); }

i just try this request 270 times for different chars and get 3 times the error shown above

does anybody have also this problem since wednesday ?

You shouldn’t be sending your token as a query param. Send it as an Authorization: Bearer <YOUR_TOKEN> header.

Probably related to this.

i already do that

  function get_Bearer ( $auth_token, $useragent ) {
    $ch = curl_init();
    $header='Authorization: Bearer '.$auth_token;
    $verify_url='https://login.eveonline.com/oauth/verify';
    curl_setopt($ch, CURLOPT_URL, $verify_url);
    curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array($header));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
    $result = curl_exec($ch);
    if ($result===false) {
        echo (__FUNCTION__ . "Authorization: Bearer" . curl_error($ch));
        exit;
    }
    curl_close($ch);
    $response=json_decode($result);

I mean when looking up your character’s skillqueue. Your first code example shows you doing &token=" . $auth_token;.

ah thx!

edit: it works