Advertisement API HTTP/1.1 401 Unauthorized


#1

Hi

i’m mike and i recently are working the API integration with Amazon Advertisement API, following the instruaction of the https://advertising.amazon.com/API/docs/v2/guides/authorization#Generate-API-tokens, we already get the authorization code, by this code, we also get the access token and refresh token successfully.

When we want to create the profile in the sandbox or when we try to get the profile, we always get one error.

HTTP/1.1 401 Unauthorized

The following is our code example, according to Amazon’s example

for example, the url in the sandbox would be https://advertising-api-test.amazon.com/v2/profiles/register

Request request = Request.Get(url).
addHeader(“Host”,“advertising-api.amazon.com”)
.addHeader(“Authorization”,“Bearer”+“Our Access Token”)
.addHeader(“Amazon-Advertising-API-ClientId”, “Our Client ID”).
addHeader(“Amazon-Advertising-API-Scope”,“1834670349683089580748”).
addHeader(“Content-Type”,“application/json”);

We will appreciate a lot for any useful info, it’s quite weried. I don’t know how to fix it.

Thank You

Best Regards

Mike


#2

Thanks for reaching out.

While requesting for access to Amazon advertising scope,
you must have received access to a JIRA account.

You can use that JIRA account to reach out to Advertising team directly for this query.
Alternatively, you can reply to the onboarding email you received from Amazon advertising.