You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I coudn't find a basic Hello World program just to test water of this API so I just followed instructions and copy one from example program, seems fairly straightforward. I do have a basic private app setup and IAM etc, but the program does not work. I am wondering if someone could help me out here. Following is the program, I have all the credentials embedded in the program (for illustration purposes only because of security). I have verified all the credential settings in seller central and IAM, all seem correct.
from sp_api.base import Marketplaces
from sp_api.api import Orders
from sp_api.base import SellingApiException
print("to start")
order_client = Orders(credentials=credentials, marketplace=Marketplaces.US)
print ("got order set up")
try:
order = order_client.get_order('111-8737621-6072221')
except SellingApiException as ex:
print (ex)
exit(1)
print(order) # order is an ApiResponse
print(order.payload) # payload contains the original response
derek@derek-ubuntu-V22:~/code/Amazon$ python sp-api.py
to start
got order set up
[{'message': 'Access to requested resource is denied.', 'code': 'Unauthorized', 'details': ''}]
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I coudn't find a basic Hello World program just to test water of this API so I just followed instructions and copy one from example program, seems fairly straightforward. I do have a basic private app setup and IAM etc, but the program does not work. I am wondering if someone could help me out here. Following is the program, I have all the credentials embedded in the program (for illustration purposes only because of security). I have verified all the credential settings in seller central and IAM, all seem correct.
from sp_api.base import Marketplaces
from sp_api.api import Orders
from sp_api.base import SellingApiException
credentials=dict(
refresh_token='Atzr|IwEBIAeNv4Z2GL3EEPJhaL3j0ivsdfsNF23nbON6xSOgNzfsdfsqhOdxxqdF8O5YJsuHmJQnq_hb5QAt9WUhCPQy9WJQ7QAgo_2ReNtwLN8csjfksdjwerewlkpMcIVGaZMTzAt8oNpO15_Y5rus8PJsP9t-iol9OlB1zfe-jCLchOoWcbsobZuXMGyZ1W4D8Kq6HadFtZwudUoAV1Er0tqt5MWZ2jIqytipKtlgV1KyZtiu6F1qAzc5oGP-6bsynsVDFQzkvgSamYuBQY1cRovqhcDz6VjUpGw1EUWZ1ZKczUn0',
lwa_app_id='amzn1.application-oa2-client.b0707c805aff3fdfdfdd5fb80ad',
lwa_client_secret='a0ba8a4ca9bb68a7f21d811190sfsdfwew3dcaf0eca7edd21a1cd5ddf59712d45',
aws_access_key='AKIAU4HIJJJJJJC2WGGGGG45',
aws_secret_key='QEICGUHGHGHGHGHGHG+Yxxzrg0y/N5VW29ttH',
)
print("to start")
order_client = Orders(credentials=credentials, marketplace=Marketplaces.US)
print ("got order set up")
try:
order = order_client.get_order('111-8737621-6072221')
except SellingApiException as ex:
print (ex)
exit(1)
print(order) #
order
is anApiResponse
print(order.payload) #
payload
contains the original responsederek@derek-ubuntu-V22:~/code/Amazon$ python sp-api.py
to start
got order set up
[{'message': 'Access to requested resource is denied.', 'code': 'Unauthorized', 'details': ''}]
Beta Was this translation helpful? Give feedback.
All reactions