尝试发布UnderArmour Connected Fitness api中的access_token endpoint时收到403 "Developer Inactive"错误 . 正在使用的 client_id 处于活动状态 . 通话中使用的网址是:https://api.ua.com/v7.1/oauth2/access_token/
在获得授权代码后,这是使用python调用的片段:
import requests
access_token_url = 'https://api.ua.com/v7.1/oauth2/access_token/'
access_token_data = {'grant_type': 'authorization_code',
'client_id': CLIENT_ID,
'client_secret': CLIENT_SECRET,
'code': authorize_code}
response = requests.post(url=access_token_url, data=access_token_data)
In [24]: response
Out[24]: <Response [403]>
In [25]: response.content
Out[25]: '<h1>Developer Inactive</h1>'
其中CLIENT_ID和CLIENT_SECRET是我在开发人员门户网站上的注册值 .
1 回答
对api.ua.com的所有调用必须包含'api-key'标头值,否则,您将收到403 Developer Inactive错误 .
这段代码展示了如何在python中执行此操作: