-
Type:
Suggestion
-
Resolution: Answered
-
None
-
Component/s: API - REST, Repository - Branch Listing, Repository - Branches / Tags
-
None
Problem Statement:
I am trying to see if we have a Bitbucket REST API call which will provide commit ID information for a file in a branch
I was able to use the below end point if the file exists in default master branch but unable to construct one for a file residing in a branch
curl -k -X GET -u username:password https://bitbucket-server-instance/bitbucket/rest/api/1.0/projects/PROJ/repos/test-repo/commits/?path=test.yml
But doesn't seem to work for a non-default branch.
Suggested resolution:
Have a API which can add the filename and it would provide the Commit ID of that file.
/REST/API/1.0/PROJECTS/{PROJECTKEY}/REPOS/{REPOSITORYSLUG}/branch/COMMITS?File&path