API lädt unendlich lange

Hi, ich versuche mittels der Admin API auf Daten zuzugreifen. Der Auth Bearer token funktioniert soweit. Aber der Anschließende Call z… um die Produkte oder Kategorien auszulesen läd ewig und endet dann nach 5 Minuten mit NULL:

 

// Get access token
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, ‘######URL#######/api/oauth/token’);
$body = json_encode(array(
            ‘client_id’ => ‘SW*******’,
            ‘client_secret’ => ‘VH*************************************************’,
            ‘grant_type’ =>‘client_credentials’
        ));

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”);
                     curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
                     curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
    ‘Content-Type: application/json’,                                                                                
    'Content-Length: ’ . strlen($body))                                                                       
);
$myApiData = curl_exec($ch);
curl_close($ch);
$var = json_decode($myApiData);
$bearer = $var->{‘access_token’};

// Get prod
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, ‘#####URL########/api/v1/category?limit=1’);
$body = json_encode(array(
            ‘Authorization’ => 'Beaerer '.$bearer
        ));

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”);
                

curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
                     curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
    ‘Content-Type: application/json’,                                                                                
    'Content-Length: ’ . strlen($body),
        'Authorization: Beaerer '.$bearer             
                     
                     )                                                                       
);
$myApiData = curl_exec($ch);
curl_close($ch);
$var = json_decode($myApiData);

var_dump($var);

 

 

 

Was mache ich falsch bzw. hat jemand ähnliche Probleme?

 

Danke & Grüße

 

Hat sich erledigt… Bearer   falsch geschrieben. Lol Sorry