POST api/login

Login to Abacus REST API. A user can login to api from different devices at the same time, for each device the user will be given different token.

Request Information

URI Parameters

None.

Body Parameters

Abacus user's credentials to login.

LoginAttemptDto
NameDescriptionTypeAdditional information
Username

Abacus user's name.

string Required.
Password

Abacus user's password.

string Required.
DeviceId

DeviceID such as Android IMEI

string Required.
DeviceName

Name of device.

string

Request Formats

application/json, text/json

Sample:
{
  "username": "sample string 1",
  "password": "sample string 2",
  "deviceId": "sample string 3",
  "deviceName": "sample string 4"
}

application/xml, text/xml

Sample:
<LoginAttemptDto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Fern.Abacus.ObjectModel.Dto">
  <DeviceId>sample string 3</DeviceId>
  <DeviceName>sample string 4</DeviceName>
  <Password>sample string 2</Password>
  <Username>sample string 1</Username>
</LoginAttemptDto>

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Information

Response Codes

Success Status:

  • Created (201), please see resource description below.

Failed Status(es):

Resource Description

The authenticated token is returned with user's id.

UserTokenDto
NameDescriptionTypeAdditional information
UserID

Abacus user's id.

integer
Token

Abacus REST API authenticated token for the logged in user.

string The token length and the token expiry are configurable in Web.Config file. By default the token expiry is 12 hours. The token gets expired if it has not been used for the period of token expiry.
TerminalId

Terminal that's associated with the device that requested this token.

integer

Response Formats

application/json, text/json

Sample:
{
  "userID": 1,
  "token": "sample string 1",
  "terminalId": 1
}

application/xml, text/xml

Sample:
<UserTokenDto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Fern.Abacus.ObjectModel.Dto">
  <TerminalId>1</TerminalId>
  <Token>sample string 1</Token>
  <UserID>1</UserID>
</UserTokenDto>