class Login (View source)

API that allows to log in with an user account.

Properties

DoliDB $db

Methods

__construct()

Constructor of the class

array
loginUnsecured(string $login, string $password, string $entity = '', int $reset = 0)

Login

array
index(string $login, string $password, string $entity = '', int $reset = 0)

Login

Details

__construct()

Constructor of the class

array loginUnsecured(string $login, string $password, string $entity = '', int $reset = 0)

Login

Request the API token for a couple username / password. WARNING: You should NEVER use this API, like you should never use the similar API that uses the POST method. This will expose your password. To use the APIs, you should instead set an API token to the user you want to allow to use API (This API token called DOLAPIKEY can be found/set on the user page) and use this token as credential for any API call. From the API explorer, you can enter directly the "DOLAPIKEY" into the field at the top right of the page to get access to any allowed APIs.

Parameters

string $login

User login

string $password

User password

string $entity

Entity (when multicompany module is used). '' means 1=first company.

int $reset

Reset token (0=get current token, 1=ask a new token and canceled old token. This means access using current existing API token of user will fails: new token will be required for new access)

Return Value

array

Response status and user token

Exceptions

RestException
RestException

array index(string $login, string $password, string $entity = '', int $reset = 0)

Login

Request the API token for a couple username / password. WARNING: You should NEVER use this API, like you should never use the similar API that uses the GET method. This will expose your password. To use the APIs, you should instead set an API token to the user you want to allow to use API (This API token called DOLAPIKEY can be found/set on the user page) and use this token as credential for any API call. From the API explorer, you can enter directly the "DOLAPIKEY" into the field at the top right of the page to get access to any allowed APIs.

Parameters

string $login

User login

string $password

User password

string $entity

Entity (when multicompany module is used). '' means 1=first company.

int $reset

Reset token (0=get current token, 1=ask a new token and canceled old token. This means access using current existing API token of user will fails: new token will be required for new access)

Return Value

array

Response status and user token

Exceptions

RestException
RestException