1. Bitbucket
  2. Public Issue Tracker
  3. master
  4. Issues

Issues

Issue #2560 resolved

Username suggestions via API

Chamilo
created an issue

Currently the regular interface provides username autocompletion / suggestions via jQuery's autocomplete widget, backed by requests to http://bitbucket.org/xhr/users/?term=part_of_a_username

Considering that the API allows you to grant privileges to users it would be nice to have some kind of API endpoint that offers the same functionality as mentionned above. Without it, one has to go back and forth between bitbucket and the client application to verify and/or copy usernames. Not a big issue when it's a limited amount of people, but it does decrease the usability of the privileges-endpoint.

The same thing would probably be usefull for groups as well.

Comments (5)

  1. Dylan Etkin

    Hi Chamilo,

    I am not 100% sure what you are suggesting. As you say, you can get the username suggestions via the REST resource for the autocomplete. We also provide REST resources for adding privileges via a group or individual.

    Are you suggesting that the privileges API also does autocomplete? How would that API know the difference between an incorrectly completed username and a possible suggestion? Can you not just make REST calls to the autocompletion and then use the results to send to the privileges API?

    Thanks,

    Dylan

  2. Hans De Bisschop

    (posting under my own account now)

    Hi,

    First things first: the privileges API should definitely not be doing any autocompletion. As you say: there's no way it would be able to tell the difference between alternate suggestions.

    That being said, my initial idea was to simply use http://bitbucket.org/xhr/users/?term=part_of_a_username for the suggestions and to indeed pass that on to the privileges API. However this particular endpoint requires that you are authenticated on bitbucket (by means of whichever protocols Bitbucket implements), which apparently isn't quite the same as the basic authentication as implemented by the "regular" APIs.

    I couldn't find any documentation either about the "true" API equivalent of the aforementioned suggestion-endpoint, so I figured I'd simply ask about it.

    So I guess the basic issue is authentication to be abled to call the autocompletion endpoint via REST.

    Thanks for the super-speady reply!

    Hans

  3. Erik van Zijst staff

    All of bitbucket now support all authentication methods. So no longer can basic auth be used exclusively against the API. Basic can be used to authenticate against every single bit of Bitbucket.

    Same for OAuth (no longer API-only) and cookies (which can now also be used against the API.

  4. Log in to comment