0.0.7 • Published 5 years ago

data-fornix-web-api v0.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

Data-Fornix-Web API SDK

This Data-Fornix-Web API SDK provides a set of method's for JavaScript applications to verify user, capture and save data.

Getting Started

1. Obtaining an API token

In order to start integration, you will need the API token.

2. Including/Importing the library

2.1 HTML Script Tag Include

Include it as a regular script tag on your page:

<script src='dist/data-fornix-web-api.js'></script>

2.2 NPM style import

You can also import it as a module into your own JS build system (tested with Webpack).

$ npm install --save data-fornix-web-api
// ES6 module import
import DataFornixApi from 'data-fornix-web-api'

// commonjs style require
var DataFornixApi = require('data-fornix-web-api')

3. initializing the SDK

You are now ready to initialize the SDK:

// Create instance of DataFornix Web API SDK
// and store it in `dataFornixAPIInstance` for future use
const dataFornixAPIInstance = new DataFornixApi({
        apiToken: <Your API TOKEN HERE>,
        baseUrl: <Your Server Base Url>
    });

To verify that SDK is successfully initialized or not, you can pass callback function as second parameter

const dataFornixAPIInstance = new DataFornixApi(
    {
        apiToken: <Your API TOKEN HERE>,
        baseUrl: <Your Server Base Url>
    },
    function (response) {
        console.log('api sdk ready to use', response);
    }
);

4. Create User

You also need to create user after SDK initialize and before any other sdk method call.

Call createUser method

// dummy user object
const userData = {
    "email":"VALID_USER",
    "name":"USER_NAME",
    "phone_number":"USER_PHONE",
    "country_code":"USER_COUNTRY_CODE"
}

const createUserRes = dataFornixAPIInstance.createUser(userData);
// Return promise object
createUserRes.then(function (success) {
    // call SDK other methods here
    console.log('Call SDK other methods here')
}, function (error) {
    console.log('Error in create use => ', error);
});

Parameters

Following parameters are using to initialize API SDK:

  • apiToken {String} required

    A API Token is required in order to authorise. If one isn’t present, an exception will be thrown.

  • callback {Function} optional

    Callback function that fires when the Api SDk successfully initialized.

Documentation for API Endpoints

MethodDescription
createUserThis method is for get user details from database before other api call.
createUserTokenThis method is for generate unique token for user and return saved details from database.
documentDataCaptureThis method is for capture data from provided documents.
documentDataSaveThis method is for save captured document into database.
checkVideoResponsiable for store and verify user video.
SelfieVerifyResponsiable for store and verify user selfie image.
getAssetsThis method is responsiable for send all assets list.
deleteAssetThis method is responsiable for delete asset.
getSharedAssetsThis method is responsiable for send all user shared assets list.
organisationAssetRequestResponsiable for send list of organisation request for assets.
organisationAllAssetRequestResponsiable for send list of organisation request for all assets.
updateAssetDetailsResponsiable for update asset data and store.
uploadAssetRequestResponsiable for send list of upload asset request.
generateSelfieTokenResponsiable for get selfie token.
selfieVerifyWithTokenResponsiable for send selfie using unique token.
getSelfieResultResponsiable for get selfie match status with other asset.

Documentation for Method

0.0.7

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago