Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Is REST API Get file or directory contents with query bugged?

Martin William
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 14, 2024

Currently using the API to do a recursive search for `path ~ package.json` with `max_depth` set to 6. No issues when just adding `max depth=6` that correctly returns the files, but adding the query for a specific path (or anything) returns the "something went wrong page".

Could be me doing something wrong but wanted to check

id on the page was 

10cace11c97b47f0b8efbcbf3ffd5896

1 answer

1 vote
Martin William
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 14, 2024

Seems it was indeed my fault, I had been using 

encodeURIComponent on previous longer routes and followed the same pattern,  but removing that fixed the issue

previous: 
const query = encodeURIComponent('path ~ "package.json"');
const maxDepth = 6;
?max_depth=${maxDepth}&q=${query}`

now: 
?max_depth=${maxDepth}&q=path~"package.json"

Suggest an answer

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

Atlassian Community Events