Advertising API Responds with Empty Profile ID Array


#1

I’m trying to get the profiles attached to my account so that I can populate the Amazon-Advertising-API-Scope header in a report request.

I’m sending a GET request to /profiles, but the response body always comes back with [ ] an empty array. The options for my request are below. Any help is much appreciated!

        method: 'GET',
        url: 'https://advertising-api.amazon.com/v1/profiles',
        headers: {
            'Host': 'advertising-api.amazon.com',
            'Authorization': `Bearer ${this.accessToken}`,
            'Content-Type': 'application/json'
        }

#2

Hi AgencyPMG, I’m experiencing the same issue. Did you happen to come across a solution?


#3

I also need the answer for this issue. Anyone help??


#4

Hi,

Can you please share a code snippet of where you are making the Login with Amazon Authorization request on your site to receive the access token as well as your Client id?


#5

I’m attempting to do the same thing as AgencyPMG. I keep getting an empty array as a response. I’ve tried with multiple Amazon accounts, but still no luck.

Can somebody please help? Any insight would be appreciated.

axios.get(`https://advertising-api.amazon.com/v1/profiles/`,
        {
          headers: {
            'Authorization': `Bearer ${req.body.amazon_access_token}`,
            'Content-Type': 'application/json',
            'Access-Control-Allow-Credentials': true
          }
        }
      )

#6

HI Did you solve the problem?


#7

I wa not having enough permissions now my issue resolved


#8

@lakshmi_kethireddy what do you mean you about the permissions?

I’m having an issue with get_profiles(), I get the error 401 Unauthorized. Help!


#9

my profile did not had permissions to access marketing api reports.
for 401 Unauthorized you might be not passing correct access token.

Steps are : Get authorization code using the below url

https://www.amazon.com/ap/oa?client_id=YOUR_CLINET_ID &scope=cpc_advertising:campaign_management&response_type=code&redirect_uri=YOUR_REIRECT_URL(the one which you have setup using register application in login with Amazon

the above url redirects to the redirect url with authorization code param
pass authorization code in the below url

curl -k -v -X POST -H “Content-Type:application/x-www-form-urlencoded;charset=UTF-8” --data "grant_type=authorization_code&code=AUTH_CODE&redirect_uri=YOUR_REDIRECT_URL&client_id=CLIENT_ID&client_secret=CLIENT_SECREThttps://api.amazon.com/auth/o2/token

the above one gives access token which you need to pass toget profiles.

HOPE THIS help.

all the steps are mentioned in the below url
https://advertising.amazon.com/API/docs/guides/authorization


#10

Have you solved the problem, and if you have, can you help?


#11

We also have the same problem with the empty array. Access to the sandbox still works fine, but if we change the endpoint to production (https://advertising-api-eu.amazon.com) we getting no profile information when we do a GET on /v1/profiles.

So, how can we get the profile_id?


#12

In the meantime, I was able to fix the problem. The LwA-Account (Login with Amazon) has to be the right to mangage advertising data.
You can do that under the following link: https://sellercentral.amazon.de/gp/account-manager/home.html/ref=ag_userperms_dnav_xx_

You may need to provide an identity card and electricity bill.


#13

I am currently having this issue. Has anyone found a solution? I really feel there should be something in the docs about this.


#14

Any solution here? Also getting an empty profile_id array


#15

For me, the issue ended up being that I was using the test endpoint (copy/pasted from the documentation) rather than the production one. The below works for me.

import requests
url = 'https://advertising-api.amazon.com/v2/profiles'

headers = {'Authorization': 'bearer {}'.format(access_token),
            'Amazon-Advertising-API-ClientId': client_id,
           'Content-Type': 'application/json',
           'User-Agent': 'App Name'
          }

response = requests.get(url, headers=headers)

profile_id = response.json()[0]['profileId']


#16

I had the same issue. Then i fixed it using correct api endpoint. Please use correct endpoint for your region:
https://advertising.amazon.com/API/docs/v2/guides/supported_features#API-Endpoints


#17

I had experiencing same issue


#18

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.


#19

This was the issue! Thanks a million!


closed #20

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.