Download snippet from gitlab with access token

How to access files on GITLAB private repositories with Access-Tokens:

Generate an Access Token

Go on gitlab and generate access token

Make sure you copy the code and store it somewhere safe. You cannot display the token any more, but only to regenerate another one

Access snippet with access token via CURL

curl --header "PRIVATE-TOKEN: <my_access_token>"<snippet_id>/raw | bash -