question

HMD Tam Nguyen avatar image
HMD Tam Nguyen asked

How to get profile?

Dear sir/Madam,
I have Access token already for next step

Follow the instructions here: https://advertising.amazon.com/API/docs/en-us/reference/2/profiles#/Profiles/listProfiles

We see the parameters no need Access token. soI build my url like that

$this->UrlForAmazonAPI=" https://advertising-api.amazon.com";
$this->AccessToken= $_COOKIE[$this->AmzCookieName];
$EndPoint = '/v'.$this->Version. '/profiles';
$TheUrl = $this->UrlForAmazonAPI . $EndPoint.'?';
$TheUrl = $TheUrl . http_build_query(
array( "Amazon-Advertising-API-ClientId" => "{ $this->ClientID}",
"apiProgram" =>"campaign",
"accessLevel" =>"view",
"profileTypeFilter" =>"vendor"
));
return redirect($TheUrl);


The error appear:

{"code":"UNAUTHORIZED","details":"HTTP 401 Unauthorized","requestId":"MD1R9TJ2MHFHGM85KYAM"}

May I ask some question?

Why don't we need access token?
How to build to get profile?

Thanks



 
               
advertise your app
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers