0

我关注 hipchat 网站并尝试获取附加令牌 https://developer.atlassian.com/hipchat/guide/hipchat-rest-api/api-access-tokens?_ga=2.94621780.975509804.1497491262-871504840.1479901346#APIaccesstokens-Add -ongeneratedtokens

我有以下代码:

import requests

secret = 'hipchat_secret'
headers = {'Content-Type': 'application/x-www-form-urlencoded',
           'Authorization': 'Basic {}'.format(secret)}

url = 'https://api.hipchat.com/v2/oauth/token?grant_type=client_credentials&scope=send_notification+admin_room'

res = requests.post(url, headers=headers)

但它给了我一个 500 内部服务器错误。我的代码有什么问题?

4

1 回答 1

0

错误是我使用了 v1 令牌。

当我切换到 v2 时效果很好

于 2017-07-21T01:29:12.103 回答