[Era, Cata, Retail] API returns 401 Unauthorized for every endpoint / namespace

// create curl resource
$ch = curl_init();

curl_setopt($ch, CURLOPT_HTTPHEADER, array(
‘Content-Type: application/json’,
'Authorization: Bearer ’ . $token
));

    // set url
    curl_setopt($ch, CURLOPT_URL, "$url");

and yes, remove the get parameter in the url.