Skip to content

Instantly share code, notes, and snippets.

@Vishwas1
Last active January 23, 2024 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vishwas1/776d8f782099cd35cf7247341ab1698b to your computer and use it in GitHub Desktop.
Save Vishwas1/776d8f782099cd35cf7247341ab1698b to your computer and use it in GitHub Desktop.

How to integrate Cavach API in your App?

  • Last Edited: 23/01/2024
  • Edited By: Vishwas Anand (github@vishwas1)

Step 1: Register & Login

Navigate to developer dashboard and login.

image image

Step 2: Register an app and get API secret key

Now register your app and generate API sercret key

Click on +Create button and fill the form to register an app image

  • Select Service - Select a which you want to associate with your app
    • Cavach API service - Aadhaar verification APIs (select this serivce for Aadhaar verification)
    • SSI API service - Self sovereign identity APIs
  • Allowed Origins - Whitelist origins from where you will make call to your service APIs. You may add * to wildcard domains.

Make sure to copy and save API secret key, we will need this in a minute. You can always regenerate this key from developer dashabord image

Also, click on Edit icon on your app's card, it will open a slider where you can copy your Cavach tenant URL. Keep your cavach tenant URL handy.

image

Step 3: Get an accessToken using your secret key

Call POST https://stage.hypermine.in/developer/dashboard/api/v1/app/oauth API by passing the API secret key in the header to get accessToken. This token your will need in all api calls you make to your Cavach Tenant API.

image

Step 4: Call Cavach APIs

Now every request you make to Cavach Tenant API (Tenant URL of your app), you need to pass the above accessToken as bearer authorization token in the header.


image

Takes Secure Aadhaar QR string as an input, extracts data from the QR string and verifies digital signature of UIDAI and returns true/false based on verification.


image

Takes base64 encoded image of the user and matches with image embedded in the secure Aadhaar QR code and returns true/false based on verification.

Note: Make sure to pass ref_id in the request body, Follow open API documentaion.


image

Generate OTP in user;s addhaar linked phone number.


image

Verify OTP sent to user's addhaar link phone number.

  • Test Aadhaar Id: 123456789012
  • Test OTP: 121212

Note: Make sure to pass ref_id in the request body, Follow open API documentaion.


Open API documentation (swagger): You can follow open API documenation for your Cavach APIs here: image

How to get user's data

By default no user's data is shared with the client. Only verification result are shared. But we provide a privacy preserving way to request one or more user's data. This is to ensure we are complied with India's DPDP'23 law. To request one or more user;s data, you need to form Query Request in /aadhaar/qr/verify and /aadhaar/otp/verify APIs. See the swagger documentation for your tenant's swagger documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment