Authentication
Note: This method is part of the Common API, exposed by the Common WebService.
The LoginSession endpoint authenticates the user and creates a session on the WebService, returning an authentication token (AuthToken) for use in subsequent calls to the Common API.
HTTP POST Request
| Request Type | Example URL |
|---|---|
| POST | {{url_base}}/LoginSession |
| Example | http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"LoginSession" |
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Login | String(100) | Yes | User name for system authentication |
| EncryptedPassword | String | Yes | User's encrypted password. When Active Directory authentication is enabled, it must be sent in AES‑256/CBC using the same key as the mobile app |
| BranchNo | String(25) | Yes | Branch code where the user is signing in |
Return
| Parameter | Type | Required | Description |
|---|---|---|---|
| WebServiceReturn | WebServiceReturn | Yes | Standard WebService response information when executing the method. |
| SessionInfoData | LoginSessionInfoData | Yes | Object with authenticated session data, including the authentication token (AuthToken) |
📝 LoginSessionInfoData object
The LoginSessionInfoData object represents the session information created after login.
Return Parameters
Parameter Type Required Description UserCode Integer Yes Internal user code in the system UserName String Yes Short user name AuthToken String Yes Authentication token generated for the session. Must be used in the AuthTokenfield of authenticated calls.AuthTokenExpiration DateTime Yes Date/time when the authentication token expires (after this time, a new login is required)
Request Example
curl --location 'http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"LoginSession"' \
--header 'Content-Type: application/json' \
--data '{
"Login": "edata",
"EncryptedPassword": "7012A6A2FE642116DE7BB",
"BranchNo": "0102",
"AuthType": "atMIMS"
}'
Response Example
{
"WebServiceReturn": {
"Status": "wrsSuccess",
"ErrorCode": "",
"Message": "",
"Actor": "",
"ReturnQuestion": null
},
"SessionInfoData": {
"UserCode": 12345,
"UserName": "TEST USER",
"AuthToken": "3F2C8A0D4B61441FAF9D0C2A6B8E9F10",
"AuthTokenExpiration": "2025-11-11T21:00:00"
}
}