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

Closed Posted 2 years ago Paid on delivery
Closed Paid on delivery

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

Project ID: #31744757

About the project

2 proposals Remote project Active 2 years ago

2 freelancers are bidding on average $23 for this job

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 More

$20 USD in 1 day
(3 Reviews)
2.1