Codelayer API Documentation

  • Introduction

    • General
    • Version History
  • API Reference

    • System

      • License request
      • Register Device
      • Authentication
    • Acounts

      • Reports

        • Daily Statement
        • Daybook
        • Debtors Balance
    • Masters

      • Customers
      • Products
    • Sales

      • Reports

        • Gatepass Register
        • Sales Summary
        • Sales Summary0
        • Vehicle Rent Details
    • Response Codes
Codelayer API Documentation
Authentication

Authenticates a user to the API using user name and password. On successful authentication a key is provided. For any further communication to the API the provided key must be used. This key may expire/timeout. On such situations the application has to get another key by re-authentication to the API.

URL

system/auth

Method

POST

Request Media type

application/json

Response Media type

application/json

Request Parameters
Parameter Data Type Min Max M/O Sample Value Comments
key String 32 32 M psl9iaciw1DuXRzRr3nyvinbcezBynM6 Key obtained from authentiaction.
username String 1 64 M testuser This is the username provided to login to the API
password String 1 64 M testpassword This is the password provided to login to the API
imei String 14 16 M 352099001761481 IMEI of the accessing device.
ver String 7 16 M 1.0.0.0 Application version of the client. Current supported version is 1.0.0.0
license_key String 86 M ci8oYXcJgSDiCUvgVewjySW0N/IbJq4PJnmURf3Ve6LMjE4JyhadAZl7BYlUM77Vxds4hOUo3VhVZl4sHpIKHA License Key

 

Response Values
Name Data Type Min Length Max Length M/O Sample Value Comments
key String 32 32 M QH7LlQ3wQMK9oYEKjeG5QOIVJQT4emeq This key to be used for all API calls (256 bit)
features String M 1,2 Coma seperated list of feature IDs available to the user.

 

Sample Request
{
    "key": "QH7LlQ3wQMK9oYEKjeG5QOIVJQT4emeq",
    "username": "testuser",
    "password": "testpassword",
    "imei": "352099001761481",
    "ver": "1.0.0.0",
    "license_key": "ci8oYXcJgSDiCUvgVewjySW0N/IbJq4PJnmURf3Ve6LMjE4JyhadAZl7BYlUM77Vxds4hOUo3VhVZl4sHpIKHA"
}
Sample Success Response
{
    "key": "QH7LlQ3wQMK9oYEKjeG5QOIVJQT4emeq",
    "features": "1,2",
    "e": 200,
    "msg": "Success"
}
Sample Failure Responses
{
    "e": 400,
    "msg": "Bad Request."
}
{
    "e": 401,
    "msg": "Invalid authentication credentials."
}