I am trying to search for code in my workspace using the API. We have Premium and have generated an API key and granted read permissions accordingly. Requests to other endpoints work. However, I never get any values back with the following call. When I go to the repo online at Bitbucket, I find entries for the master branch.
What's the problem? How can I do it so that it works?
Hi @Jonas Lüthi
Welcome to the Bitbucket Cloud community! :)
The parameters you've used are almost correct, they just need to be adjusted slightly.
This is the correct input:
https://api.bitbucket.org/2.0/workspaces/workspaceID/search/code?search_query=repo:reposlug customer
If executed in cURL directly with url encoding, that will look like this:
curl --request GET \
--url 'https://api.bitbucket.org/2.0/workspaces/workspaceID/search/code?search_query=repo%3Areposlug%20test' \
--header 'AuthGoesHere'
Hope this helps!
Cheers!
- Ben (Bitbucket Cloud Support)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.