Im currently trying to write a little addin for my IDE so i can create snippets on my gitlab. I have checked the API and it seems its possible to create snippets associated with a project using /api/v3/project/id/snippet
and the according POST parameters. However I dont really want to associate the snippets with a particular project and in the web interface its possible to choose "My Snippets" and when you create a snippet there you dont have to attribute it to a project. I wonder if there is also an API to create a snippet thats not linked to a project but rather to my account?
Also according to https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/project_snippets.md#create-new-snippet its not possible to choose the visibility of the snippet while in the web interface you can chosse private, public or internal. Is there something else? Is the API out of date? Thanks in advance.
There is no REST API to change or view user snippets.
To set visibility, you can use attribute visibility_level
(although undocumented, it is actually required). It uses the same level numbers as projects.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With