Search code API - Error: SEARCH_NOT_ENABLED

Bootta11
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!
October 7, 2024

 

Hi. When i call search code API using next url:

https://api.bitbucket.org/2.0/workspaces/SomeUsername/search/code?search_query=%22find-this%22

I get response with error:

{"type": "error", "error": {"message": "Search is not enabled for the requested account", "detail": "Navigate to https://bitbucket.org/search to turn it on", "data": {"key": "SEARCH_NOT_ENABLED"}}, "data": {"key": "SEARCH_NOT_ENABLED"}}

As suggested in error message I navigate to https://bitbucket.org/search to turn on search. But error still persists when using api from url above.

2 answers

1 accepted

1 vote
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 8, 2024

Hi and welcome to the community!

Are you trying to search via API on your own workspace?

The ID was visible in the URL you posted here because it was only changed in the display text (I have just edited).

For the part SomeUsername it looks like you were using your workspace's name instead of the workspace's ID. If you meant to search your own workspace, you will need to use its ID instead (and not the name).

You can find the ID on your browser's address bar if you open this workspace on your browser

https://bitbucket.org/workspace-id/workspace/overview/

You can also see it in the Workspace settings (from the cog menu on the top right corner, when you have opened this workspace's page on Bitbucket's website).

Could you give it a try and let me know if this works?

Kind regards,
Theodora

0 votes
Bootta11
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!
October 8, 2024

Yes @Theodora Boudale , you are right. Now I figured that im using workspace name instead id, that was problem. Thanks for help. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events