In short
- Share the patient’s profile with the counter whose QR code they scanned.
- The share returns
202and arequest_id; poll with it for the token. - On
success, showtoken_numberandexpiry; onfailed, offer to scan again.
When to use this
The patient is at a facility’s registration counter and scans its Health Facility QR code in your PHR app. You share their ABHA profile with that counter, so the facility’s software registers them without a form. Then you show the token number the facility issues. This is the PHR side. If your software runs the facility’s counter and receives the scanned profile, use Receive a scanned profile as a HIP instead.Before you start
- A client access token, sent as a Bearer token. See Authorization.
- A logged-in patient and their Eka user id (
oid), sent as theX-Pt-Idheader or theoidquery parameter. See Log in to an existing ABHA. - A live ABHA gateway session, if this call needs one. See Hold an ABHA gateway session.
- A QR scanner in your app, and permission to read the device location.
- The patient’s profile: ABHA address, name, gender, day, month and year of birth, and mobile. See Manage the ABHA profile and KYC.
Sequence
Steps
1
Share the profile
Read
hip_id and counter_id from the scanned QR code. Send both, the device’s latitude and longitude in location, and the patient’s profile in patient, to Request to generate token. In patient, abha_address, name, gender, day_of_birth, month_of_birth, year_of_birth and mobile are required.The call is asynchronous. It returns HTTP 202 with request_id and status. Keep request_id. 2
Poll for the token
Call Get appointment token with
request_id in the path. The response carries status, token_number and expiry.The spec gives status three values: success, processing and failed. While it is processing, the facility has not answered; call again. When it is success, show token_number and its expiry to the patient. When it is failed, tell the patient the share did not go through and offer to scan again. State you must persist
When it fails
Errors come back as HTTP 4XX or 5XX with aGenericError body: code, error and source_error. Codes are 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 Stage/Sandbox server,https://api.dev.eka.care.
- Share with the test
hip_id,counter_id, a location and the patient’s profile returns202and arequest_id - Polling with that
request_idmoves fromprocessingtosuccesswith atoken_numberandexpiry - Share without
counter_idfails with a 4XX - Poll with an unknown
request_idfails - A facility that does not answer: polling stops at your limit and the app tells the patient

