This project won't work anymore as aadhaar offline-kyc website deprecated(https://resident.uidai.gov.in/offline-kyc).
Aadhaar Paperless Offline e-KYC is a secure and shareable document which can be used by any Aadhaar holder for offline verification of identification.(https://resident.uidai.gov.in/offline-kyc)
Postman Link: https://www.getpostman.com/collections/ce378a9aa6040b0f55e0
This server exposing 3 APIs to download a ZIP file containing the Resident's Paperless Offline eKYC from UIDAI website.
- API to fetch captcha from UIDAI - GetCaptcha.
- API to enter aadhaar number and captcha received in GetCaptcha API.
- By calling this API, user will get an OTP to the phone number associated to aadhaar.
- API to enter OTP received and four digit zipCode(share code).
These APIs depend on https://resident.uidai.gov.in/offline-kyc
website.
By using these APIs client can expose their own interface to user.
go run cmd/server/main.go
OR
go run cmd/server/main.go --conf configs/local.yml
This server exposing 2 type of API interfaces(gRPC and REST). Default port for gRPC server is 4444 and REST is 3333. (configs/default.yml).
This can be changed by adding environment specific configs.
Example:
Add configs/local.yml
and run go run cmd/server/main.go --conf configs/local.yml
# sample config
server:
grpcPort: 4444
httpPort: 3333
host: "0.0.0.0"
logger:
outputPath: "stdout"
level: "info"
disableStackTrace: true
accessLogger:
outputPath: "stdout"
level: "error"
disableStackTrace: true
aadhaarCacheStore:
type: redis # default memory
redis:
host: "localhost:6379"
password: ""
db: 0
import "github.com/aaabhilash97/aadhaar-paperless-offline-ekyc-apis/pkg/aadhaarapi"
If client wants to use gRPC interface, client can generate client code from api/proto
using protobuf compiler.
Postman Link: https://www.getpostman.com/collections/ce378a9aa6040b0f55e0
To fetch captcha and session id from UIDAI.
{
"status": {
"code": <string | response status code>,
"message": <string | message>
},
"data": {
"session_id": <string | session id>,
"captcha_image": <string | base64 encoded image>
}
}
Once captcha fetched, need to call this API with aadhaar number(uid_no) and captcha(security_code).
On success user will receive an OTP on phone number associated with aadhaar.
{
"session_id": <string | session id>,
"uid_no": <string | Enter your 12 digit Aadhaar number or 16 digit Virtual ID to begin.>,
"security_code": <string | captcha received by user>
}
{
"status": {
"code": <string | response status code>,
"message": <string | message>
}
}
Call this API with OTP received to download zip file from UIDAI and fetch details.
{
"session_id": <string | session id>,
"otp": <string | 6 digit OTP or 8 digit TOTP.>,
"zip_code": <string | 4 characters>,
"include_zip_file": <bool | to include zip file in response>,
"include_xml_file": <bool | to include xml file in response>
}
{
"status": {
"code": <string | response status code>,
"message": <string | message>
},
"data": {
"details": {
"poi": { // Proof of identity
"dob": <string | Example: 10-09-1991>,
"gender": <string | F or M>,
"mobile_hash": <string>,
"name": <string | Name as in aadhaar>
},
"poa": { // Proof of address
"careof": <string>,
"country":<string>,
"dist": <string>,
"house": <string>,
"landmark":<string>,
"pincode": <string>,
"postoffice":<string>,
"state": <string>,
"street":<string>,
"subdist": <string>,
"vtc": <string>,
},
"photo": <string | Base64 encoded image of face photo>
},
"zip_file": <string | Base64 encoded zip file downloaded from uidai>,
"xml_file": <string | Base64 encoded xml file adhaar Paperless Offline e-KYC>
}
}