Seller Forums
Sign in
Sign in
imgSign in
imgSign in
user profile
Seller_ZHBKu4aywF9ak

SP-API Reports Endpoit returns 403 Error

I've build this app to retrieve data for our internal reports. The app has all roles and permissions assigned to it. Nevertheless, I can access all SP-API endpoints except for the most important one: Reports.

They all return an 403 erros: [{'code': 'Unauthorized', 'message': 'Access to the resource is forbidden', 'details': ''}]

Sample Request (using python requests module)

url = 'https://sellingpartnerapi-na.amazon.com/reports/2021-06-30/reports'

headers = {

# 'host': 'https://sellingpartnerapi-na.amazon.com',

'user-agent': f'{AppId}/{AppVersion} (Language={LanguageName}/{LanguageVersion})',

'x-amz-access-token': atoken,

'x-amz-date': f'{datetime.datetime.now().strftime("%Y%m%dT%H%M%SZ")}'

}

payload = {

"reportOptions": {

"reportPeriod": "DAY",

"asinGranularity": "SKU"

},

"reportType": "GET_SALES_AND_TRAFFIC_REPORT",

"dataStartTime": f"{dataStartTime}",

"dataEndTime": f"{dataEndTime}",

"marketplaceIds": [

"ATVPDKIKX0DER"

]

}

r = requests.post(url, json=payload, headers=headers)

What am I missing here?

35 views
1 reply
Tags:Reporting
00
Reply
user profile
Seller_ZHBKu4aywF9ak

SP-API Reports Endpoit returns 403 Error

I've build this app to retrieve data for our internal reports. The app has all roles and permissions assigned to it. Nevertheless, I can access all SP-API endpoints except for the most important one: Reports.

They all return an 403 erros: [{'code': 'Unauthorized', 'message': 'Access to the resource is forbidden', 'details': ''}]

Sample Request (using python requests module)

url = 'https://sellingpartnerapi-na.amazon.com/reports/2021-06-30/reports'

headers = {

# 'host': 'https://sellingpartnerapi-na.amazon.com',

'user-agent': f'{AppId}/{AppVersion} (Language={LanguageName}/{LanguageVersion})',

'x-amz-access-token': atoken,

'x-amz-date': f'{datetime.datetime.now().strftime("%Y%m%dT%H%M%SZ")}'

}

payload = {

"reportOptions": {

"reportPeriod": "DAY",

"asinGranularity": "SKU"

},

"reportType": "GET_SALES_AND_TRAFFIC_REPORT",

"dataStartTime": f"{dataStartTime}",

"dataEndTime": f"{dataEndTime}",

"marketplaceIds": [

"ATVPDKIKX0DER"

]

}

r = requests.post(url, json=payload, headers=headers)

What am I missing here?

Tags:Reporting
00
35 views
1 reply
Reply
1 reply
Follow this discussion to be notified about new activity
user profile
Seller_ZHBKu4aywF9ak

SP-API Reports Endpoit returns 403 Error

I've build this app to retrieve data for our internal reports. The app has all roles and permissions assigned to it. Nevertheless, I can access all SP-API endpoints except for the most important one: Reports.

They all return an 403 erros: [{'code': 'Unauthorized', 'message': 'Access to the resource is forbidden', 'details': ''}]

Sample Request (using python requests module)

url = 'https://sellingpartnerapi-na.amazon.com/reports/2021-06-30/reports'

headers = {

# 'host': 'https://sellingpartnerapi-na.amazon.com',

'user-agent': f'{AppId}/{AppVersion} (Language={LanguageName}/{LanguageVersion})',

'x-amz-access-token': atoken,

'x-amz-date': f'{datetime.datetime.now().strftime("%Y%m%dT%H%M%SZ")}'

}

payload = {

"reportOptions": {

"reportPeriod": "DAY",

"asinGranularity": "SKU"

},

"reportType": "GET_SALES_AND_TRAFFIC_REPORT",

"dataStartTime": f"{dataStartTime}",

"dataEndTime": f"{dataEndTime}",

"marketplaceIds": [

"ATVPDKIKX0DER"

]

}

r = requests.post(url, json=payload, headers=headers)

What am I missing here?

35 views
1 reply
Tags:Reporting
00
Reply
user profile
Seller_ZHBKu4aywF9ak

SP-API Reports Endpoit returns 403 Error

I've build this app to retrieve data for our internal reports. The app has all roles and permissions assigned to it. Nevertheless, I can access all SP-API endpoints except for the most important one: Reports.

They all return an 403 erros: [{'code': 'Unauthorized', 'message': 'Access to the resource is forbidden', 'details': ''}]

Sample Request (using python requests module)

url = 'https://sellingpartnerapi-na.amazon.com/reports/2021-06-30/reports'

headers = {

# 'host': 'https://sellingpartnerapi-na.amazon.com',

'user-agent': f'{AppId}/{AppVersion} (Language={LanguageName}/{LanguageVersion})',

'x-amz-access-token': atoken,

'x-amz-date': f'{datetime.datetime.now().strftime("%Y%m%dT%H%M%SZ")}'

}

payload = {

"reportOptions": {

"reportPeriod": "DAY",

"asinGranularity": "SKU"

},

"reportType": "GET_SALES_AND_TRAFFIC_REPORT",

"dataStartTime": f"{dataStartTime}",

"dataEndTime": f"{dataEndTime}",

"marketplaceIds": [

"ATVPDKIKX0DER"

]

}

r = requests.post(url, json=payload, headers=headers)

What am I missing here?

Tags:Reporting
00
35 views
1 reply
Reply
user profile

SP-API Reports Endpoit returns 403 Error

by Seller_ZHBKu4aywF9ak

I've build this app to retrieve data for our internal reports. The app has all roles and permissions assigned to it. Nevertheless, I can access all SP-API endpoints except for the most important one: Reports.

They all return an 403 erros: [{'code': 'Unauthorized', 'message': 'Access to the resource is forbidden', 'details': ''}]

Sample Request (using python requests module)

url = 'https://sellingpartnerapi-na.amazon.com/reports/2021-06-30/reports'

headers = {

# 'host': 'https://sellingpartnerapi-na.amazon.com',

'user-agent': f'{AppId}/{AppVersion} (Language={LanguageName}/{LanguageVersion})',

'x-amz-access-token': atoken,

'x-amz-date': f'{datetime.datetime.now().strftime("%Y%m%dT%H%M%SZ")}'

}

payload = {

"reportOptions": {

"reportPeriod": "DAY",

"asinGranularity": "SKU"

},

"reportType": "GET_SALES_AND_TRAFFIC_REPORT",

"dataStartTime": f"{dataStartTime}",

"dataEndTime": f"{dataEndTime}",

"marketplaceIds": [

"ATVPDKIKX0DER"

]

}

r = requests.post(url, json=payload, headers=headers)

What am I missing here?

Tags:Reporting
00
35 views
1 reply
Reply
1 reply
1 reply
Quick filters
Sort by
Follow this discussion to be notified about new activity
user profile
Quincy_Amazon

Hello @Seller_ZHBKu4aywF9ak

Thank you for posting your inquiry to the Forums.

While I am not able to answer your question, I would suggest opening a case with Developer Support for additional guidance.

Regards,

Quincy_Amazon

00
user profile
Quincy_Amazon

Hello @Seller_ZHBKu4aywF9ak

Thank you for posting your inquiry to the Forums.

While I am not able to answer your question, I would suggest opening a case with Developer Support for additional guidance.

Regards,

Quincy_Amazon

00
Reply
Follow this discussion to be notified about new activity