Question

github provide public ssh key by URL like http://github.com/user.keys.

Is there a way also in bitbucket to obtain public keys via URL?

Was it helpful?

Solution

Using Bitbucket's REST API version 1, you can get the SSH keys of a user with this endpoint:

https://bitbucket.org/api/1.0/users/#{user}/ssh-keys

Here is a full reference from the API documents:

https://confluence.atlassian.com/display/BITBUCKET/ssh-keys+Resource

I'm not sure if they plan to include this in version 2 of their API, but it should work with other API calls.

You need an account to authenticate your requests. Here is how to use the REST APIs: https://confluence.atlassian.com/display/BITBUCKET/Use+the+Bitbucket+REST+APIs

EDIT:
Here's the relevant documentation for v2 of their REST API:
https://developer.atlassian.com/bitbucket/api/2/reference/meta/authentication https://developer.atlassian.com/bitbucket/api/2/reference/resource/users/{username}/ssh-keys

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top