Skip to main content

Authentication

Authentication is an essential part of most applications. In this guide, you will learn how authentication works with Data Sutram's API.

Introduction#

Whenever 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:

token: <token>

Getting an Auth Token#

An 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 platform#

Send a POST request to https://console.datasutram.com/auth/signup with the following request body:

{
"firstname": <your-first-name>,
"lastname": <your-last-name>,
"email": <your-email>,
"password": <your-password>,
"roles": [<roleA>, <roleB>, ...]
}

These are the possible roles that you can request for:

RoleDescription
basicAccess to the Grid, POI, Geotools and Location Scorecard API
ip_risk_assessmentAccess to the IP Risk Assessment API
merchant_acquisitionAccess to the Merchant Acquisition API
merchant_scorecardAccess to the Merchant Scorecard API

If all your inputs are valid then you will get a success response like this:

{
"success": true
}

Logging In#

Send a POST request to https://console.datasutram.com/auth/signin with the following request body:

{
"email": <your-email>,
"password": <your-password>
}

If your credentials are valid then you will get a response with the auth token:

{
"token": <your-auth-token>
}

Use this token for all subsequent authenticated requests.