question

newuser-722f54ad-01fa-4cc6-83ee-87eeff559907 avatar image

Amazon DSP API gives blank output

I am using amazon dsp v2 api ( /dsp/reports) from our advertiser account whose type is agency and subtype is not amazon_Attribution as per api documentation. I am able to hit the api but receiving blank output for all metrics (campaign, technology etc). But from the console i can see data is present for giving date range. Is this access issue or something else. Below is my sample code

def dsp_report(self):

try:

r = requests.post(

f'{ https://advertising-api.amazon.com/dsp/reports',

json={

"endDate": '20210619',

"format": 'JSON',

"type": 'CAMPAIGN',

"startDate": '20210520',

"dimensions": ['ORDER', 'LINE_ITEM', 'CREATIVE' ],

"metrics": ",".join(['agencyFee','totalCost','impressions','viewableImpressions','clickThroughs']),

},

headers=self.headers,

)

r = r.json()

reportId = r["reportId"]


while r['status'] == 'IN_PROGRESS':

r = requests.get(

f'https://advertising-api.amazon.com/dsp/reports/{reportId}',

headers=self.headers,

)

r = r.json()

print(r)

assert r['status'] == 'SUCCESS'

location = r["location"]

api
10 |5000

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

1 Answer

Levon@Amazon avatar image
Levon@Amazon answered

Hi,

Thank you for posting in the Amazon Developer forums.

For assistance with this issue, please contact Amazon Advertising: https://advertising.amazon.com/contactus

10 |5000

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