Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I get ssh public key from url in bitbucket?

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?

like image 200
ironsand Avatar asked Apr 30 '14 19:04

ironsand


1 Answers

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

like image 106
Cameron Tinker Avatar answered Sep 19 '22 13:09

Cameron Tinker