Authentication
Authentication is an essential part of most applications. In this guide, you will learn how authentication works with Data Sutram's API.
#
IntroductionWhenever a user successfully logs in using their credentials, a JSON Web Token (JWT) will be returned. This token needs to be present in the HTTP Request Header for all subsequent authenticated requests. The user agent should send the JWT under the token header. The content of the header should look like the following:
#
Getting an Auth TokenAn auth token (JWT) is only returned by the API upon successfully logging in using registered credentials. Enterprise users will be able to register and log in using their organisation email as well.
#
Registering on the platformSend a POST
request to https://console.datasutram.com/api/auth/signup
with the following request body:
These are the possible roles that you can request for:
Role | Description |
---|---|
basic | Access to the Grid, POI, Geotools and Location Scorecard API |
ip_risk_assessment | Access to the IP Risk Assessment API |
merchant_acquisition | Access to the Merchant Acquisition API |
merchant_scorecard | Access to the Merchant Scorecard API |
If all your inputs are valid then you will get a success response like this:
#
Logging InSend a POST
request to https://console.datasutram.com/api/auth/signin
with the following request body:
If your credentials are valid then you will get a response with the auth token:
Use this token for all subsequent authenticated requests.