Messente avatar logo

Verification API Documentation

Starting User Authentication

If your Service's User is starting the login process, you must initiate authentication on the Verigator side as well.

Request URL

Request to register a service will be made to the following URL:

POST https://api.verigator.com/v1/service/service/{ServiceId}/users/{UserID}/auth

Where {ServiceID} in the URL will be replaced with your ServiceID and {UserID} will be replaced with UserID of the user.

Request headers
HTTP headerDescriptionRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
X-Service-AuthRefer to authentication section on how to authenticate your API calls with Messente API username and passwordYes
Request body (JSON encoded)
KeyDescriptionRequired
methodtotp - Prefer TOTP verification with Verigator App. In case app is not set up for this user, Verigator will fallback to SMS automatically.
sms - Start SMS-based authentication
Yes
Response body (JSON encoded)
KeyValue
methodtotp - TOTP authentication method was used
sms - SMS-based authentication was initiated
auth_idIn case of sms-based authentication (method=sms), this is the ID of Verification SMS
HTTP Response Codes
STATUS codeValueDescription
201CreatedUser successfully created
401Authentication required
Missing authentication headers (X-Service-Auth)
403ForbiddenForbidden request
404Not foundUser not found
409ConflictConflict
422Invalid dataInvlalid request body - check the format and if it was correctly JSON encoded

EXAMPLES

from messente.verigator.api import Api

# Initialize API
api = Api("messente-api-username", "messente-api-password")

# Create your service
service = api.services.get("my-service-id")

# Initialize user
user = api.users.get(service.id, "verigator-user-id")

# Start authentication
auth_id = api.auth.initiate(service.id, user.id, api.auth.METHOD_TOTP)

public static final String API_USERNAME = "";
public static final String API_PASSWORD = "";
public static final String VERIGATOR_SERVICE_ID = "";

// Initialize the Verigator API with your Messente API credentials
Verigator verigator = new Verigator(API_USERNAME, API_PASSWORD);

// After creating the service, for all future requests you get Service instance like this:
service = Service.get(verigator, VERIGATOR_SERVICE_ID);

// Now you can start syncing your service's users to Verigator
User user = service.registerUser("youremail@example.com", "+3725555555");

// You can use SMS or TOTP (verification via Verigator app)
if (USE_SMS) {
    user.authenticateUsingSMS();
} else {
    user.authenticateUsingTotp();
}