Driving License Check API
VERIFICATION OF DRIVING LICENSE NUMBER, VALIDITY, CATEGORY AND RELATED DETAILS

API Outcome
- Name Of Holder Name of the driving license holder
- Category Category, class of vehicle and issued date for each class
- License Type Transport or non transport type
- Registered Location Office of road transport where the license is registered
- Associated Dates Issued and expiry dates
API Details
Request
Type | URL |
---|---|
POST | https://api.attestr.com/api/{version} /public/checkx/dl |
Request Body Parameters
Type | Name | Description | Optional (default) | Min Version | Max Version |
---|---|---|---|---|---|
String | reg | Input DL number to be verified. | Required | v1 | |
String | dob | Date of birth of license holder in DD-MM-YYYY format | Required | v1 | |
Boolean | webhook | Boolean indicating whether webhook should be triggered after request is processed | Optional | v1 |
Request Header Parameters
Type | Name | Value / Description | Optional | Min Version | Max Version |
---|---|---|---|---|---|
String | Content-Type | application/json | Required | v1 | |
String | Authorization | Basic {authToken} | Required | v1 |
If you do not have the authentication token, please refer to Register App to generate one.
Sample Request Payload
{
"reg": "GJ0120XX0001923",
"dob": "27-10-1989",
"webhook": true
}
Response
HTTP Status 200
Key | Description | Type | Min Version | Max Version |
---|---|---|---|---|
_id | Unique request Id to be used later for querying the result | String | v1 | |
number | Unique human readable number to be used for any reference later | String | v1 |
{
"_id": "AR02zfeuv2iz5ksij09nf",
"number": "3801-575765-9695"
}
Querying Driving License Check Result
Get Async Request Outcome API
Type | URL | Min Version | Max Version |
---|---|---|---|
GET | https://api.attestr.com/api/{version}/public/async/<asyncId> | v1 |
Request Header Parameters
Type | Name | Value / Description | Optional | Min Version | Max Version |
---|---|---|---|---|---|
String | Content-Type | application/json | Required | v1 | |
String | Authorization | Basic {authToken} | Required | v1 |
Request URL Parameters
Name | Description | Min Version | Max Version |
---|---|---|---|
asyncId | Replace <asyncId> in the URL with the _id received in the driving license record search API response as described above. | v1 |
Response
Http Status 200
Key | Description | Type | Min Version | Max Version |
---|---|---|---|---|
_id | Request Id as queried in the URL | String | v1 | |
number | Request number as generated in the driving license search API response | String | v1 | |
requestId | Unique ID used by Attestr for request tracing purposes | String | v1 | |
status | Status of the request. Possible values are - COMPLETED, INITIATED, ERRORED | String | v1 | |
input | The input details used for driving license search | String | v1 | |
output | Driving License check output object. Details described as below. Null if status is errored or initiated. | DrivingLicenseOutputRecord | v1 | |
error | Error object if the operation ran into errors, null otherwise. Null if status is completed or initiated. | String | v1 | |
created | Unix timestamp when the request was placed. | Number | v1 | |
updated | Unix timestamp when the request was last updated. Null if status is initiated. | Number | v1 | |
signature | Signature generated using the output and client secret. Used for validating the accuracy of data. Null if status is errored or initiated. | String | v1 |
Driving License Output Record
Please note that the valid key decides the availability of rest of the keys in the response. If the provided DL number does not exist, all keys except valid and message are omitted. If true, remaining keys will have appropriate data.
Key | Description | Type | Min Version | Max Version |
---|---|---|---|---|
valid | True | false depending on if provided DL number exists and is valid | Boolean | v1 | |
active | True | false depending on if provided DL number is currently active | Boolean | v1 | |
owner | Name of the driving license holder | String | v1 | |
issued | Date of issue of driving license DD-MM-YYYY | Date | v1 | |
rto | Name of RTA office where license is registered | String | v1 | |
ntpIssued | Date of issue of non transport category (Set as null if the non transport category is not applicable) DD-MM-YYYY | Date | v1 | |
ntpExpiry | Date of expiry of non transport category (Set as null if the non transport category is not applicable) DD-MM-YYYY | Date | v1 | |
tpIssued | Date of expiry of transport category (Set as null if the transport category is not applicable) DD-MM-YYYY | Date | v1 | |
tpExpiry | Date of expiry of transport category (Set as null if the transport category is not applicable) DD-MM-YYYY | Date | v1 | |
type | Type of driving license | DLTypeEnum | v1 | |
categories | Categories mapped to provided license | Array of DLCategory object | v1 | |
message | Error message if provided PAN is invalid | String | v1 |
DLTypeEnum
Enum Values | Description |
---|---|
TRANSPORT | Transport category driving license |
NONTRANSPORT | Non transport category driving license |
BOTH | Registered under both transport and non transport category |
DLCategory
Key | Description | Type | Min Version | Max Version |
---|---|---|---|---|
cov | Class Of Vehicle | String | v1 | |
issued | Date of issue for this class of vehicle MM-DD-YYYY | Date | v1 | |
type | Type of this category. Can hold only one of the 2 values TRANSPORT | NONTRANSPORT | String | v1 |
Sample Response
Sample response for valid DL
{
"valid": true,
"active": true,
"owner": "GITANJALI RAHEJA",
"issued": "01-09-2017",
"rto": "RTO,SURAT",
"ntpIssued": "01-09-2017",
"ntpExpiry": "01-08-2037",
"tpIssued": null,
"tpExpiry": null,
"type": "NONTRANSPORT",
"categories": [
{
"cov": "MCWG",
"issued": "01-09-2017",
"type": "NONTRANSPORT"
}
]
}
Sample response for invalid driving license details
{
"valid": false,
"message": "Provided driving license number and dob combination does not exist"
}
Error Response
Parameter | Type | Description |
---|---|---|
code | Number | Unique error codes for different errors. Always available. |
message | String | Error message describing the error. Always Available. |
details | String | Detail error message. Available only for certain types of errors. |
Error Codes
HTTP Status | Error Code | Error Message |
---|---|---|
400 | 4001 | Malformed data or missing required parameter values |
400 | 4005 | Operation could not be performed due to low credits balance |
401 | 4016 | Invalid client authorization |
403 | 4031 | Unauthorized access |
403 | 4035 | Requested service is not provisioned for your account |
403 | 4039 | Client's IP address is not whitelisted |
403 | 4035 | Requested service is not provisioned for your account |
429 | 4291 | Maximum account rate limit exceeded |
429 | 4292 | Maximum API rate limit exceeded |
429 | 4293 | Maximum account daily limit exceeded |
429 | 4294 | Maximum API daily limit exceeded |
500 | 5001 | Request could not be processed |
Sample Error Response
{
"code": 4001,
"message": "Malformed data or missing required parameter values"
}
Webhooks
Driving License check supports the following two webhook events.
See Webhooks for more details on how to register webhooks.
- async.completed
- async.errored
To enable webhooks, the API input parameter webhook must be set as true while initiating the request.
Webhook Event Payload
Key | Type | Description | Min Version | Max Version |
---|---|---|---|---|
_id | String | ID of the async request. This is same as received in the output of Person / Business search API as described above. | v1 | |
requestId | String | Unique request ID for internal tracing purposes. | v1 | |
status | String | One of INITIATED, COMPLETED OR ERRORED | v1 | |
output | Object | Driving License Check output object same as output key described in Querying Driving License Result API above. | ||
error | Object | Error object if the driving license check runs into errors. The structure of this is same as the Error Response object described above. | v1 | |
signature | String | generated using hmacHexDigest of output object and client secret. Null if archived. |
Validating the signature
Generate signature on your server side code base and check if it matches the signature returned in the payload. To generate the signature, use the SHA256 algorithm, the client secret and the output value to generate a HMAC Hex Digest as shown in the sample code below.
const crypto = require("crypto");
var clientSecret; // This should be initialized as client secret.
var apiResponse; // This is apiResponse as retuned in step 6.
function hmacHexDigest(secret, input) {
const hmac = crypto.createHmac('sha256', secret)
hmac.update(input)
return hmac.digest('hex')
}
var signature = hmacHexDigest(clientSecret, JSON.stringify(apiResponse.result));
// Check if signature matches
if(signature !== apiResponse.resultSignature){
// Flow is tampered.
}