【发布时间】:2021-11-21 15:11:55
【问题描述】:
我正在尝试获取我们公司 bitbucket 云的 repo 详细信息。 使用 API:
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'
问题是我使用的每个密钥/令牌,我都会得到一个错误响应
{"type": "error", "error": {"message": "Access token expired."}}
我创建了一个 OAuth 2.0 密钥和密钥并尝试了它们。
--header 'Authorization: Bearer <KEY>'
--header 'Authorization: Bearer <SECRET>'
我也试过应用密码:
--header 'Authorization: Bearer <APP PASSWORD>'
也可以使用 SSH 密钥:
--header 'Authorization: Bearer <SSH KEY>'
但我得到了同样的错误。
谢谢
【问题讨论】: