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

Chiuso Pubblicato 2 anni fa Pagato alla consegna
Chiuso Pagato alla consegna

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 = '[login to view URL] ';

$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

PHP Amazon

Rif. progetto: #31744757

Info sul progetto

2 proposte Progetto a distanza Attivo 2 anni fa

2 freelance hanno fatto un'offerta media di $23 per questo lavoro

lmhunhthanh91

I have more than 5 years of experience working with PHP, MySQL, API, HTML, Javascript, Node Js, Vue Js, Css, Git, C#, SQL Server, Devexpress, and integrating online payment gateways, Paypal, Payer, PerfectMoney. I can Altro

$20 USD in 1 giorno
(3 valutazioni)
2.1