Skip to main content
deleted 1 character in body
Source Link
swysocki
  • 868
  • 5
  • 8

The parameter should come at the end of the URL:

Invoke-RestMethod -Uri https://gitlab.com/api/v4/projects/1234567?private_token=$my_private_token 

IfI prefer to pass the token in the header:

Invoke-RestMethod -Headers @{ 'PRIVATE-TOKEN'=$_my_private_token } -Uri http://gitlab.com/api/v4/projects/1234567 

https://docs.gitlab.com/ee/api/#personalproject-access-tokens

The parameter should come at the end of the URL:

Invoke-RestMethod -Uri https://gitlab.com/api/v4/projects/1234567?private_token=$my_private_token 

If prefer to pass the token in the header:

Invoke-RestMethod -Headers @{ 'PRIVATE-TOKEN'=$_my_private_token } -Uri http://gitlab.com/api/v4/projects/1234567 

https://docs.gitlab.com/ee/api/#personalproject-access-tokens

The parameter should come at the end of the URL:

Invoke-RestMethod -Uri https://gitlab.com/api/v4/projects/1234567?private_token=$my_private_token 

I prefer to pass the token in the header:

Invoke-RestMethod -Headers @{ 'PRIVATE-TOKEN'=$_my_private_token } -Uri http://gitlab.com/api/v4/projects/1234567 

https://docs.gitlab.com/ee/api/#personalproject-access-tokens

Source Link
swysocki
  • 868
  • 5
  • 8

The parameter should come at the end of the URL:

Invoke-RestMethod -Uri https://gitlab.com/api/v4/projects/1234567?private_token=$my_private_token 

If prefer to pass the token in the header:

Invoke-RestMethod -Headers @{ 'PRIVATE-TOKEN'=$_my_private_token } -Uri http://gitlab.com/api/v4/projects/1234567 

https://docs.gitlab.com/ee/api/#personalproject-access-tokens