如何查找 Bitbucket 帐户 UUID?

How to find Bitbucket Account UUID?

由于 bitbucket 不再支持使用用户名。我们必须改用用户 uuid 来访问 bitbucket api。

折旧或更早

https://api.bitbucket.com/2.0/users/udayRatan

最新

https://api.bitbucket.com/2.0/users/558050:c0b72ad0-1cb5-4018-9cdc-0cde8492c443

您可以对您拥有的存储库发出 GET 请求,并在 owner 属性下查看您的 UUID:

curl https://api.bitbucket.org/2.0/repositories/1team/moxie

或者您可以为您所在团队的所有团队成员发出 GET 请求,并在其中查看他们的 UUID

curl https://api.bitbucket.org/2.0/teams/1team/members

信息取自https://developer.atlassian.com/bitbucket/api/2/reference/meta/uri-uuid#repo-obj

使用经过身份验证的访问时,您可以向 /2.0/user 发出 GET 请求,您将获得经过身份验证的用户的信息:

$ curl -H "Authorization: Bearer $TOKEN" https://api.bitbucket.org/2.0/user

您需要 account_id 的值才能访问 API 资源。

发件人:https://developer.atlassian.com/bitbucket/api/2/reference/resource/user

我不敢相信获得我自己的 UUID 会这么难。我修复它的方法是创建一个 public 存储库,然后 运行 这个 curl 命令

curl https://api.bitbucket.org/2.0/repositories/<bitbucketusername>/testrepo

输出包含我的 UUID。然后我显然删除了不安全的 public 仓库。

  1. 检查你的https://bitbucket.org/account/settings/
  2. 在浏览器检查器元素中搜索“uuid”
  3. 享受您的个人信息(包括uuid)