In short
- Verify the professional’s Aadhaar with an OTP, then check the Aadhaar-linked mobile.
- If Get HPR Info finds an existing HPR ID, save it and stop.
- Otherwise the professional picks a handle and you call Create HPR.
- Create takes
txnIdandhprIdin camel case.
When to use this
A doctor, nurse or other healthcare professional at the facility needs a Healthcare Professional Registry (HPR) ID. You want them to get it without leaving your HMS. The flow:- Verifies their Aadhaar with an OTP.
- Confirms the mobile they give is the one linked to Aadhaar.
- Returns the HPR ID they already have, or creates a new one.
Before you start
- A bearer token for the Eka API. See Authorization.
- The headers your integration sends on ABDM Connect calls. Each operation in this workflow accepts
X-Pt-Id,X-Partner-Pt-IdandX-Hip-Id. - The professional’s Aadhaar number, the mobile linked to it, and their consent to use Aadhaar, recorded on your side.
- The professional’s category and sub-category, email, pincode and a password, which Create needs.
Sequence
Steps
1
Send the Aadhaar OTP
Send
aadhaar to Get Aadhaar OTP. The response data carries txn_id, mobile_num and hint. Keep txn_id; every later call in this workflow needs it. The professional receives an OTP on the mobile linked to their Aadhaar.2
Verify the Aadhaar OTP
Send
txn_id and the otp the professional reads out to Verify Aadhaar OTP. The response data carries txn_id. Use the txn_id from this response in the next call. 3
Verify the linked mobile
Send
txn_id and the mobile_num the professional gives to Verify Mobile. Read verified in the response data. If verified is false, stop and show reason; the mobile does not match Aadhaar. If it is true, keep txnId. The response can also carry hpr.hprId and suggested_hpr_ids. 4
Check for an existing HPR ID
Send
txn_id and mobile_num to Get HPR Info. The response data carries the professional’s profile (first_name, last_name, category_id, pincode and others), hpr_id, hpr_id_number, new, token and txn_id. If an HPR ID already exists, save hpr_id and hpr_id_number on the staff record and stop; do not create a second one. Otherwise continue to Suggest. 5
Get suggested HPR IDs
Send
txn_id to Suggest IDs. The response data is a list of suggested HPR ID handles. Show them to the professional and let them pick one, or type their own. 6
Create the HPR ID
Send
txnId, the chosen hprId, and the professional’s details to Create HPR. Note the field names: this body uses txnId and hprId in camel case, where earlier calls use txn_id. Prefill first_name, middle_name, last_name and pincode from the Get HPR Info response. The response data carries hprId and hpr_id_number. Save both on the staff record.State you must persist
When it fails
Errors come back as4XX or 5XX with a body carrying code, error and source_error (code, message). Read source_error.code for the upstream code, and look it up on the errors page.
Test it
The testing page has the sandbox base URL, credentials and the happy path for every journey. Run against the sandbox base URLhttps://api.dev.eka.care.
- Happy path for a new professional: Get Aadhaar OTP, Verify Aadhaar OTP, then Verify Mobile with
verifiedtrue. Get HPR Info shows no existing ID, then Suggest IDs, then Create returnshprIdandhpr_id_number - Second run with the same Aadhaar: Get HPR Info returns the existing
hpr_id, and your app stops without calling Create - Wrong OTP once, then the correct OTP
- A mobile that is not linked to the Aadhaar: Verify Mobile returns
verifiedfalse and your app showsreason - Create with a handle that is already taken

