Open ChakshuGautam opened 1 year ago
APIs needed:
If OTP can be handled:
Endpoint: GET /sendOTP/<ben ID> or <phoneNo + aadhaar last for digits> or <aadhaar> or <phoneNo>
Response:
{
status: "OK",
error:null
}
Endpoint: POST /verifyOTP/<ben ID> or <phoneNo + aadhaar last for digits> or <aadhaar>or <phoneNo>
Body:
{
otp: <random 4 digits>
}
Response:
{
status: "OK",
error:null
}
OR
{
status: "NOT_OK",
error: "Invalid OTP"
}
If above two API are not possible (We need an API that returns users mobile number which is linked to aadhaar or beneficiary ID)
Endpoint: GET /aadharMobileNumber/<aadhaarID> or <benID>
Response:
{
status: OK,
mobileNumber: <users_mobile_number>
error:null
}
Usage:
Used in /getOtp
and /verifyOtp
apis to send opt via aadhaar or beneficiary Id
API to fetch number of beneficiary Ids linked to mobileNumber:
Endpoint : GET /benIDFromPhoneNo/<phoneNo>
Response:
{
status:OK,
beneficiary_Ids_count: <int>,
error: null
}
Usage:
Used in /getOtp
api when only mobile number is passed. To check whether the user has multiple beneficiary Ids or not.
API to check if given masked aadhaar is mapped to given mobileNumber:
Endpoint: GET /verifyAadhaarMobileNo/?phoneNo=&maskedAadhaar=
Response:
{
aadhaar_status: true/false,
error: null
}
Usage:
Used in /getOtp
api to check if given masked aadhaar and phonenumber are linked or not.
API to get basic user details via given aadhaar/beneficiaryId/phoneNumber (or by sending just aadhaar)
Endpoints: GET /userDetails/<aadhaar/beneficiaryId/phoneNumber>
Response:
{
status:OK,
error:null,
user: {
fatherName: <string>,
dateOfRegistration: <string/date>,
dob: <string/data>,
...
}
}
Usage: Used at every message to get the user details while showing the status.
GET beneficiary status - POST
status/<aadhaar/beneficiaryId/phoneNumber/phoneNumber+Aadhaar>
Response: (error scenario)
{
"status": false,
"error": {
"errorId": "1",
"message": "Registered Professional"
}
}
Response: (success scenario)
{
"status": true,
"error": null
}
UserID
- session (https://github.com/fingerprintjs/fingerprintjs) => Update this tobenId
once it gets resolved/sendOTP/<ben ID> or <phoneNo + aadhaar last for digits> or <aadhaar> or <phoneNo>
/verifyOTP/<ben ID> or <phoneNo + aadhaar last for digits> or <aadhaar>or <phoneNo>
/getNoOfBenIDFromPhoneNo/<phoneNo>
/checkMapping/?phoneNo=&maskedAadhaar=
/udpateUserId/benId
benId
, phone)