How to use fopen fucntion to open a file (advertising Amazon report) with Authorization:Bearer

Job ID: 31744757

Budget: $10 – $30 USD

I have Amazon-Advertising-API-Scope, Amazon-Advertising-API-ClientId ,token and location
I code like this

$head = array(
'Amazon-Advertising-API-Scope:'.$ScopeID,
'Amazon-Advertising-API-ClientId:' .$ClientID,
'Authorization:Bearer '.$Token);

$context = stream_context_create(array(
'http' => array(
'method'=>'GET',
'header'=>$head)
));
//The path & filename to save to.
$saveTo = 'test.json.gz ';
$fp = fopen($Location, 'r', false, $context);

When I try to run, the error said "401 Unauthorized". I check carefully all parameters input already,
pls help me to fix it
Thank
Related categories: PHP Amazon