When calling GitLab.com’s Add a member to a group or project API to add an user as the member to a project, the user ID (integer) must be provided. Where can GitLab.com users get their user ID’s?
Hi,
Try opening your browser and going to this URL:
https://gitlab.com/api/v4/users?username=YOUR_USERNAME
where YOUR_USERNAME
is your username.
This will only work if you are already logged into GitLab.
Alternatively,
-
Copy your Personal Access Token.
-
Run the following command from a terminal:
curl --header "PRIVATE-TOKEN: TTTT" https://gitlab.com/api/v4/users?username=YOUR_USERNAME
where TTTT
is your private token and YOUR_USERNAME
is your username.
Éibhear
5 Likes
Thank you a lot!
It will be nice to see this instruction be added to FAQ.
1 Like