Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

REST API endpoint ssh-keys doesn't work.

Evans Tucker
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!
March 6, 2018

I have SSH keys in my BitBucket account, and I would like to be able to manage them via the API, but the ssh-keys endpoint doesn't work:

$ curl -H "Authorization: Bearer redacted" http://redacted/rest/api/1.0/users/evans.tucker | jq .
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 239 0 239 0 0 239 0 --:--:-- --:--:-- --:--:-- 5311
{
"name": "evans.tucker",
"emailAddress": "evans.tucker@iovation.com",
"id": redacted,
"displayName": "Evans Tucker",
"active": true,
"slug": "evans.tucker",
"type": "NORMAL",
"links": {
"self": [
{
"href": "https://redacted/users/evans.tucker"
}
]
}
}
$ curl -H "Authorization: Bearer redacted" http://redacted/rest/api/1.0/users/evans.tucker/ssh-keys
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><status><status-code>404</status-code><message>null for uri: https://redacted/rest/api/1.0/users/evans.tucker/ssh-keys</message></status>$
$

1 answer

0 votes
Caterina Curti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 11, 2018

Hi Evans,

 

Are you using a Bitbucket Server (self-hosted by your company) or a Bitbucket Cloud (available on bitbucket.org) version of Bitbucket?

 

In case of Bitbucket Server, the following applies:

- these are the available REST API endpoints for ssh keysSSH rest. As an example, a valid end point will look as the following one:

http://example.com/rest/keys/1.0/ssh/{keyId}

The one in your example looks similar to the bitbucket.org version (see some examples here).

- Which authentication method are you using? If you are using an access token, these can only be used for very specific operations on projects and repositories and these will depend on the permission level of the user (see Personal access tokens for more details).

 

Thanks, Caterina - Atlassian 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events