Hello all,
Im trying to make a list of all files with last modified date and this is my first time to use REST api. Therefore i am following the guide in https://docs.atlassian.com/bitbucket-server/rest/7.21.0/bitbucket-rest.html#idp278
in the REST docs, it says that using "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/last-modified" is the way to get last modified information of each files.
based on this guide, i create a simple python code like below
def getLastModified():
url = "https://url/rest/api/1.0/projects/myprojectname/repos/thereponame/last-modified"
auth=HTTPBasicAuth('myid', 'mypw')
response = resquest.get(url, auth=auth)
if(response.status_code != 200):
print('API fail')
else:
pass #todo
if __name__ == '__main__':
getLastModified()
however when i run this python code, the response has error code 400 which indicates bad request.
other APIs, such as 'files' and 'participants', work well if i just replace text of 'last-modified' to 'files' or 'participants' according to the atlassian document.
e.g.) url = "https://url/rest/api/1.0/projects/myprojectname/repos/thereponame/files"
i have no idea why the only 'last-modified' does not work and return error code 400.
What i need is the last modified date of each file in the trunk to create reports of my code status.
If anyone possible, please give me a kind advice to me.
Kind regards,
Kim