ADDA Access Control API

Note

To access ADDA APIs you would need to be onboarded to the ADDA API platform. ADDA API Team will issue keys/credentials post onboarding, only using which you can access the APIs.

For getting access to APIs please CONTACT US

These APIs are to be used for integrating various access control solutions with ADDA

Authentication

  • Requests are authenticated using a token and ADDA ID

  • Token and ADDA ID must be sent in headers as shown below

Example Headers

token: xxxxxxxxxxxxxxxxxxx apt: xxxxxxx

Media Type

Where applicable this API MUST use the JSON media-type. Requests with a message-body are using plain JSON to set or update resource states.

Content-type: application/json and Accept: application/json headers SHOULD be set on all requests if not stated otherwise.

Status Codes and Errors

This API uses HTTP status codes to communicate with the API consumer.

  • 200 OK - Response to a successful GET, PUT, PATCH or DELETE.

  • 201 Created - Response to a POST that results in a creation.

  • 204 No Content - Response to a successful request that won"t be returning a body (like a DELETE request).

  • 400 Bad Request - Malformed request; form validation errors.

  • 401 Unauthorized - When no or invalid authentication details are provided.

  • 403 Forbidden - When authentication succeeded but authenticated user doesn"t have access to the resource.

  • 404 Not Found - When a non-existent resource is requested.

  • 405 Method Not Allowed - Method not allowed.

  • 406 Not Acceptable - Could not satisfy the request Accept header.

  • 415 Unsupported Media Type - Unsupported media type in request.

General Notes

There are few common variables which are used across multiple APIs. The following are the explanations for the same.

apt_id / apt - This refers to an ID which is used to identify a particular Residential Community. This is a reference number used internally in ADDA system. For accessing our APIs, any partner would have to go through an onboarding process. These details can be shared during the same time with the partner.

flat_id / unit_id - This refers to an ID which is used to identify a particular Apartment/Villa/Condo inside Community. You can get the list of IDs for the Apartment/Villa/Condo inside a Community using the API: Units by Community

Vehicle RFID APIs

Authentication is required to access nearly all endpoints of this API.

Push Vehicle Event

POST https://indiaapi.adda.io/api/vehicle/event
Requestsexample 1
Headers
Content-Type: multipart/form-data
token: xxxxxxxxxxxxxxxxxxx
apt: xxxxxxx
Body
{
  "rfid": "abcdefba",
  "site_code": "00005",
  "in": false,
  "allowed": false,
  "terminal_id": "abc1234",
  "event_timestamp": 1549065700,
  "device_id": "12"
}
Schema
{
  "type": "object",
  "properties": {
    "rfid": {
      "type": "string",
      "description": "Vehicle assigned RFID"
    },
    "site_code": {
      "type": "string",
      "description": "Provided by ADDA to identify the site location"
    },
    "in": {
      "type": "boolean",
      "description": "Vehicle in/out status where 1 is for checkin and 0 is for checkout"
    },
    "allowed": {
      "type": "boolean",
      "description": "If the vehicle was allowed to go or not where 1 is for allowed and 0 is for denied"
    },
    "terminal_id": {
      "type": "string",
      "description": "Terminal identifier or location of the device"
    },
    "event_timestamp": {
      "type": "number",
      "description": "Event Unix timestamp in sec (Indian Epoch Timestamp)"
    },
    "device_id": {
      "type": "string",
      "description": "Device identifier"
    }
  },
  "required": [
    "rfid",
    "in",
    "allowed",
    "event_timestamp"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses200401500
Headers
Content-Type: application/json
Body
{
  "success": true,
  "message": "Vehicle event is posted"
}
Headers
Content-Type: application/json
Body
{
  "error": "Unauthorized"
}
Headers
Content-Type: application/json
Body
{
  "error": [
    "Server Error",
    ""
  ]
}

Push Vehicle Event
POST/api/vehicle/event

Post a vehicle checkin/checkout event.

Endpoint information

Requires authentication Yes
Has restricted scope No

Database Sync

GET https://indiaapi.adda.io/api/vehicle/sync?timestamp=
Requestsexample 1
Headers
token: xxxxxxxxxxxxxxxxxxx
apt: xxxxxxx
Responses200200200401
Headers
Content-Type: application/json
Body
{
  "active_tags": [
    {
      "vehicle_no": "",
      "rfid": "",
      "rfid_secret": "1234556",
      "flat_id": 1296170,
      "ts": "2022-01-05 14:08:35"
    },
    {
      "vehicle_no": "KA01DU0191",
      "rfid": "121221",
      "rfid_secret": "121221",
      "flat_id": 1438557,
      "ts": "2020-09-28 14:39:23"
    },
    {
      "vehicle_no": "KA09KI9090",
      "rfid": "1212222",
      "rfid_secret": "1212222",
      "flat_id": 1351220,
      "ts": "2020-09-28 14:39:40"
    },
    {
      "vehicle_no": "UP35AF8035",
      "rfid": "3305555",
      "rfid_secret": "3305555",
      "flat_id": 1296170,
      "ts": "2020-05-29 18:05:52"
    }
  ],
  "deactive_tags": [
    "1234556",
    "ABC001"
  ]
}
Headers
Content-Type: application/json
Body
[
  {
    "vehicle_no": "KA00100988",
    "rfid": "",
    "rfid_secret": null,
    "flat_id": 994994,
    "ts": "2020-02-26 13:32:21"
  },
  {
    "vehicle_no": "TEST",
    "rfid": "",
    "rfid_secret": null,
    "flat_id": 984022,
    "ts": "2020-02-26 13:32:42"
  }
]
Headers
Content-Type: application/json
Body
[
  {
    "vehicle_no": "KA00100988",
    "rfid": "",
    "rfid_secret": null,
    "flat_id": 994994,
    "ts": "2020-02-26 13:32:21"
  },
  {
    "vehicle_no": "TEST",
    "rfid": "",
    "rfid_secret": null,
    "flat_id": 984022,
    "ts": "2020-02-26 13:32:42"
  },
  {
    "vehicle_no": "3232",
    "rfid": "",
    "rfid_secret": null,
    "flat_id": 192643,
    "ts": "2020-02-26 13:24:16"
  },
  {
    "vehicle_no": "KA047786",
    "rfid": "",
    "rfid_secret": null,
    "flat_id": 1114202,
    "ts": "2020-02-26 13:34:50"
  }
]
Headers
Content-Type: application/json
Body
{
  "error": "Unauthorized"
}

Database Sync
GET/api/vehicle/sync{?timestamp}

Get vehicle plate numbers using timestamp filter.

  • If no timestamp filter is sent, response will contain the full list of vehicles.

  • If timestamp is sent, vehicles added from and after that timestamp will sent in the response.

  • If send_deactive_tags is set to true it will send First 200 response else It will send second 200 response

  • First response has “active_tags” and “deactive_tags”

  • Second response has sends only “active_tags” as an array

Endpoint information

Requires authentication Yes
Has restricted scope No
URI Parameters
HideShow
timestamp
number (optional) 

Unix timestamp in sec

send_deactive_tags
boolean (required) 

true/false


Vehicle ANPR APIs

Authentication is required to access nearly all endpoints of this API.

Push Vehicle Event

POST https://indiaapi.adda.io/api/vehicle/event
Requestsexample 1
Headers
Content-Type: multipart/form-data
token: xxxxxxxxxxxxxxxxxxx
apt: xxxxxxx
Body
{
  "plate": "KA01JT9992",
  "camera_id": "123",
  "site_code": "00005",
  "in": false,
  "db_match": true,
  "event_timestamp": 1549065700
}
Schema
{
  "type": "object",
  "properties": {
    "plate": {
      "type": "string",
      "description": "Vehicle registration number"
    },
    "camera_id": {
      "type": "string",
      "description": "Camera identifier (maps to terminal ID)"
    },
    "site_code": {
      "type": "string",
      "description": "Provided by ADDA to identify the site location"
    },
    "in": {
      "type": "boolean",
      "description": "Vehicle in/out status where 1 is for checkin and 0 is for checkout"
    },
    "db_match": {
      "type": "boolean",
      "description": "If the vehicle number has matched with ANPR database"
    },
    "event_timestamp": {
      "type": "number",
      "description": "Event Unix timestamp in sec (Indian Epoch Timestamp)"
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses200401500
Headers
Content-Type: application/json
Body
{
  "status": 0,
  "message": "Success",
  "lp": {
    "added": []
  },
  "deleted": []
}
Headers
Content-Type: application/json
Body
{
  "error": "Unauthorized"
}
Headers
Content-Type: application/json
Body
{
  "error": [
    "Server Error",
    ""
  ]
}

Push Vehicle Event
POST/api/vehicle/event

Post a vehicle checkin/checkout event.

Endpoint information

Requires authentication Yes
Has restricted scope No

Database Sync

GET https://indiaapi.adda.io/api/vehicle/sync?timestamp=
Requestsexample 1
Headers
token: xxxxxxxxxxxxxxxxxxx
apt: xxxxxxx
Responses200200401
Body
{
  "lp": {
    "all": [
      {
        "lp": "KA03JT9991",
        "ts": "2020-01-30 15:28:29"
      },
      {
        "lp": "KA_294932",
        "ts": "2020-01-31 12:09:38"
      }
    ]
  }
}
Headers
Content-Type: application/json
Body
{
  "lp": {
    "added": [
      {
        "lp": "KA03JT9991",
        "ts": "2020-01-30 15:28:29"
      },
      {
        "lp": "KA_294932",
        "ts": "2020-01-31 12:09:38"
      },
      {
        "lp": "KA_4",
        "ts": "2020-01-31 12:09:49"
      },
      {
        "lp": "KA_10",
        "ts": "2020-01-31 12:09:59"
      },
      {
        "lp": "KA03JT9991",
        "ts": "2020-01-31 12:09:30"
      }
    ],
    "deleted": []
  }
}
Headers
Content-Type: application/json
Body
{
  "error": "Unauthorized"
}

Database Sync
GET/api/vehicle/sync{?timestamp}

Get vehicle plate numbers using timestamp filter

Endpoint information

Requires authentication Yes
Has restricted scope No
URI Parameters
HideShow
timestamp
number (optional) 

Unix timestamp in sec


Generated by aglio on 04 Jul 2024