Forums

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

How to get the revision and last updated timestamp of a file in the repo's source? (API 2.0)

Michelle Gybels
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!
June 13, 2019

Hi all,

Using the 1.0 API, it was possible to get for each file the revision and date this file was last updated.

I don't find this information with the 2.0 API.

How can this be done, using the response of the result of the endpoint as documented here: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/src/%7Bnode%7D/%7Bpath%7D 

Or is this no longer possible? 

Kind regards.

1 answer

0 votes
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 21, 2019

Hi @Michelle Gybels,

You can get this information using filehistory endpoint. So if you're interested only in the commit hash and timestamp of the latest update, API request might look like this:

https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/filehistory/master/website/package.json?fields=values.commit.hash,values.commit.date&pagelen=1

Hope this helps.

Cheers,
Daniil

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events