amzn / selling-partner-api-models

This repository contains OpenAPI models for developers to use when developing software to call Selling Partner APIs.
Apache License 2.0
612 stars 739 forks source link

[BUG] Reports API. Access to requested resource is denied. Unauthorized #1807

Closed luckylion999 closed 2 years ago

luckylion999 commented 3 years ago

I am using aws_requests_auth library for AWS Signature Version 4 Signing Process. And I called SP api for creating report. But getting below error. { "errors": [ { "message": "Access to requested resource is denied.", "code": "Unauthorized", "details": "" } ] }

Here is my code.

from aws_requests_auth.aws_auth import AWSRequestsAuth

auth = AWSRequestsAuth(
    aws_access_key=<aws_access_key>,
    aws_secret_access_key=<aws_secret_key>
    aws_host='sellingpartnerapi-na.amazon.com',
    aws_region='us-east-1',
    aws_service='execute-api'
)

endpoint = f'https://sellingpartnerapi-na.amazon.com/reports/{current_date}/reports'
body = {
    'reportType': 'GET_FLAT_FILE_ALL_ORDERS_DATA_BY_LAST_UPDATE_GENERAL',
    'dataStartTime': serializer.validated_data['data_start_time'],
    'marketplaceIds': serializer.validated_data['marketplace_ids']
}
headers = {'x-amz-access-token': serializer.validated_data['access_token']}

response = requests.post(endpoint, auth=auth, headers=headers, data=body)

Hope to get help asap.

ShivikaK commented 3 years ago

Hello @luckylion000

We will need to work with you via a support case to resolve this issue. Please open a support case so we can pursue the investigation. In the support case, please provide request details including request ID and timestamp to troubleshoot the issue further.

Thanks, 
Shivika Khare
 Selling Partner API Developer Support

github-actions[bot] commented 2 years ago

This is a very old issue that is probably not getting as much attention as it deserves. We encourage you to check if this is still an issue after the latest release and if you find that this is still a problem, please feel free to open a new issue and make a reference to this one.