0

I am trying to call Gitlab API from my AngularJS code as below

$http.get("https://git.company.com/api/v4/projects?private_token=xxx");

I generated the PAT from my organization's gitlab user settings. I tried the curl command and still getting 401. If I make the same call without the private_token then I get the public projects, so connection to the API itself is not an issue. Has anytime come across this before? What am I missing?

niruj
  • 125
  • 2
  • 9

1 Answers1

-1

You need to send projectId as well in url to identify the repository in gitlab and ref as in which branch. below url has projectId as 1234 and in master branch.

https://git.company.com/api/v4/projects/1234?ref=master&private_token=xxx"