API authentication requirements question
Hello,
I'm trying to read public Gitlab repositories via API. However I'm faced with two issues:
Authentication question
On one hand the main API docs page states:
All API requests require authentication via a session cookie or token.
There are three types of tokens available: private tokens, OAuth 2 tokens, and personal access tokens.
And on the other hand the API Repositories page reads:
Get a list of repository files and directories in a project.
This endpoint can be accessed without authentication if the repository is publicly accessible.
Which one is it?
API URL
When accessing a public repo such as buble. How would the API base URL be? I can see in the docs that the endpoint would be /projects/:id/repository/tree
, but I can't seem to find the whole URL in the docs, the non-endpoint of the API Request is only refered as https://gitlab.example.com/api/v4
.
I tried https://api.gitlab.com/api/v4/projects/:projectid/repository/tree
, but no luck. I guess I'm missing something really obvious here :/