REST API not loging in

Hi, I need to use the REST API and for that I followed these steps:

  1. Create a different user with all privileges and added an API key.
  2. Enabled the REST API module
  3. Tried to login with this link (using the user and password)
    http://localhost/api/index.php/login?login=webserviceapi&password=secret

But the request will take me to the Login page and will not respond with the Key that is needed for the

http://localhost/api/index.php/explorer

Please help!

Dolibarr v11.0.1

Hi,

Normally the login operation is always available in the explorer, even if you don’t have a key (because it is the one that gives the key). Can you try it from there?

Hi! the API Explorer always takes me to the login page. I tried in version 11 and 12 with no luck. The REST module is the only module needed for this to work?

Have you got the key in the response from the server? Try upgrading to v12 if it still does not give you a key. I tested v12 quite a lot and it works for me.

Hi, thanks for your responses. I found the same issue in Stackoverflow and it seems to be an Nginx bad configuration, I am currently using Nginx for my Dolibarr instalation.

I tried what this user did and I am facing the same problem as him.

Link of the issue:

Maybe you can help us configure Nginx for this?

Thanks!