It seems never works as the doc says bellow:
https://docs.gitlab.com/ee/api/repository_files.html#get-file-blame-from-repository
In my case,
The API URL is:/api/v4/projects/9/repository/files/config.json/blame?ref=master,
It always says “{“error”:“404 Not Found”}” when I try to get a blame of a file.
Anyone know why?
By the way it is ok to get raw file.
URL: /api/v4/projects/9/repository/files/config.json/raw?ref=master
I think there should be have somewhere to turn on this API,
Is there anyone know how?
still struggle on it.
Anyone can give some help?
I have the same problem.
After complex verification, I learned that this problem may be caused by the problem of gitlab version.
If your gitlab version supports V4 API, You can get the gitlab version through the GET method:
curl --location --request GET 'https://{GITLAB_URL}/api/v4/version' \
--header 'PRIVATE-TOKEN: {PRIVATE_TOKEN}'
and then you can find your current version’s doc from url:
https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/api
You need to switch tag to your gitlab version
Happy development!