0

I am trying to use the bitbucket code search API and I am getting 401 error "Token is invalid or not supported for this endpoint."

I created a repository access token and can access this particular URL 'https://api.bitbucket.org/2.0/repositories/{username}' with an authorization bearer token in the header without any issue.

But I couldn't access the code search API with the same token. I am having an invalid token issue. My code search api -

https://api.bitbucket.org/2.0/teams/{username}/search/code?search_query=repo%3Asample%20source

username- sam

https://bitbucket.org/blog/bitbucket-code-search-api-now-available 

https://developer.atlassian.com/cloud/bitbucket/rest/api-group-other-operations/#api-teams-username-search-code-get 

I am following the above two articles. In these articles it is mentioned like 'GET /2.0/teams/{username}/search/code'

what username I should give? I already tried with 'sam'

In the first article I am seeing the api you provided and what is "%7B6f461d1e-a3dd-433b-a0e3-7a69daf6ea47%7D" ?

https://api.bitbucket.org/2.0/teams/**%7B6f461d1e-a3dd-433b-a0e3-7a69daf6ea47%7D**/search/code?search_query=repo%3Aelasticsearch%20QueryBuilders

kindly provide more suggestions on this.

Note: This is a private repository and I am the only user in it.

Nasrul Bharathi
  • 163
  • 2
  • 10

0 Answers0