Does the bitbucket rest API allow you create SSH key

Richard Huegill
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 11, 2018

 

We are to use the REST API of bitbucket (non -cloud) to add a public key to an account.

 

I found this article which suggests you can do it

https://confluence.atlassian.com/bitbucket/rest-apis-222724129.html

 

GET /users/{accountname}/ssh-keys

POST /users/{accountname}/ssh-keys

 

but I can't get it to work

I can test with this

curl -u u:p http://server:7990/rest/api/1.0/admin/users

and it works

but i can't get this to work

curl -u u:p http://servername:7990/rest/api/1.0/admin/users/<<usrername>>/ssh-keys

 

2 answers

1 vote
jredmond
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 11, 2018

That article is for Bitbucket Cloud - have a look at https://docs.atlassian.com/bitbucket-server/rest/4.1.0/bitbucket-ssh-rest.html instead.

0 votes
Richard Huegill
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 12, 2018

Thanks for that. I will have a look.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events