Where are the docs for logging-in through API?

Hi Everyone,

The organization has its own GitLab server. I am trying to make this stack overflow example work within the organization: GitLab API - How to get private_token using GET with session parameter? - Stack Overflow .

The short answer to the stack overflow question is, POST to https://gitlab.example.com/api/v4/session?login=XXX&password=YYY to get back the private token. When I attempt to use https://gitlab.example.com/api/v4/session?login=XXX&password=YYY, I get a 404 error back. The error happens with both cURL and the browser.

I’ve tried using Search in the API area, but it cannot locate documentation on how to login or what the session is. (It seems like session does not exist). Searching for “API login” and “API authenticate” is returning useless results.

Where is the documentation on logins and authentication? And where is the documentation on URI components like session? Where can I find a list of top-level URI components with an explanation of each?

Thanks in advance.

Hi,

The Gitlab API docs: API Docs | GitLab

Since the Stackoverflow is for API v3 which doesn’t exist, as you’ll see by the docs it’s API v4, that is no longer relevant. Also you will see under REST API Resources in the docs, that the session option isn’t available. From there you will see all options that the API allows you to use.

For authentication options from the main page, of which I’ve linked here for you: API Docs | GitLab