Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Search code API on private repository not working

codec
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 18, 2023

Hello,

I am trying to search code via API but for some reason it won't return code that is not in a public repository. I have tried repo:repo_slug, but it still won't return it. It will return however code in public repositories of the workspace.

I am using the same token on other routes, and never had that issue between public and private repository.

 

Example request : {{protocol}}://{{host}}/{{basePath}}workspaces/:workspace/search/code?search_query=repo:{uuid} SearchQuery

2 answers

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 20, 2023

Hi @codec,

Could you please let me know what kind of access token you are using for authentication?

There is currently a limitation with workspace access tokens, that cannot be used for authentication with the code search endpoint:

It should be possible to search using basic auth with username and app password or with an OAuth access token.

Kind regards,
Theodora

0 votes
codec
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 18, 2023

PS : it would work with Basic Auth, but not with bearer, is that intended ?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events