Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/312.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Amazon sp api。使用带有swagger生成代码的旧MWS令牌进行身份验证_Python_Amazon_Swagger Codegen_Amz Sp Api - Fatal编程技术网

Python Amazon sp api。使用带有swagger生成代码的旧MWS令牌进行身份验证

Python Amazon sp api。使用带有swagger生成代码的旧MWS令牌进行身份验证,python,amazon,swagger-codegen,amz-sp-api,Python,Amazon,Swagger Codegen,Amz Sp Api,我正在尝试使用新的sp api和混合方法连接到Amazon。我拿着模型大摇大摆地“编译”了它。然后我尝试执行示例代码: from __future__ import print_function import time import swagger_client from swagger_client.rest import ApiException from pprint import pprint # create an instance of the API class api_inst

我正在尝试使用新的sp api和混合方法连接到Amazon。我拿着模型大摇大摆地“编译”了它。然后我尝试执行示例代码:

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.AuthorizationApi(swagger_client.ApiClient(configuration))
selling_partner_id = 'selling_partner_id_example' # str | The seller ID of the seller for whom you are requesting Selling Partner API authorization. This must be the seller ID of the seller who authorized your application on the Marketplace Appstore.
developer_id = 'developer_id_example' # str | Your developer ID. This must be one of the developer ID values that you provided when you registered your application in Developer Central.
mws_auth_token = 'mws_auth_token_example' # str | The MWS Auth Token that was generated when the seller authorized your application on the Marketplace Appstore.

try:
    # Returns the Login with Amazon (LWA) authorization code for an existing Amazon MWS authorization.
    api_response = api_instance.get_authorization_code(selling_partner_id, developer_id, mws_auth_token)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AuthorizationApi->get_authorization_code: %s\n" % e)
但我收到了错误消息:

Exception when calling AuthorizationApi->get_authorization_code: (403)
Reason: Forbidden
HTTP response headers: HTTPHeaderDict({'Date': 'Thu, 03 Jun 2021 15:45:52 GMT', 'Content-Type': 'application/json', 'Content-Length': '135', 'Connection': 'keep-alive', 'x-amzn-RequestId': '6b00b699-2ce1-4973-a155-d7ecee9d7f7b', 'x-amzn-ErrorType': 'MissingAuthenticationTokenException', 'x-amz-apigw-id': 'AWvfqFUmoAMF6Yg='})
HTTP response body: {
  "errors": [
    {
      "message": "Access to requested resource is denied.",
     "code": "MissingAuthenticationToken"
    }
  ]
}
有些人说,但在文档中,这与此无关

所以我的问题是:
如何使用MWS旧令牌进行授权???

我确定什么是IAM ARN问题或授权URL问题

你可以了解国家的情况


您是否解决了此问题,我看到您希望使用旧的mws auth令牌来授权sp api。但我并没有看到下面的答案,也并没有提及任何相关内容。不,我碍事了。如果你有一个设计-欢迎你。当我解决这个问题时,我会发布新的答案。)@jamesaq12wsx-btw现在我正在尝试创建一个纯请求来完成我的任务。我已经用完了招摇过市的代码和python sp api模块。我已经与亚马逊确认,他们说你必须发布你的应用程序才能使用授权api端点,你发布了你的应用程序吗?