The Dapi Developer Hub

Dapi's world leading banking API is the bridge between your app and your users' bank accounts. Securely initiate payments and access data in real time with one simple integration.

Get Started    Guides

Connect Layer - Quickstart

Connect Layer provides a client-side functionality that allows you to authenticate user with their bank and retrieve accessCode required to obtain user's permanent token.

Basic Setup

Connect Layer does not have any standalone files that need to be downloaded or installed, instead you simply need to include a short piece of regular JavaScript in your HTML that will load the Connect into your pages.

The following snippet of code will initialize basic version of the connect layer for the Sandbox environment and load authentication page for the user:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=1080px, initial-scale=1.0">
  <title>DAPI</title>
</head>
<body>
  <script src="https://cdn.dapi.co/connect/v3/connector.js"></script>
  <script>
    var handler = Dapi.create({
      environment: Dapi.environments.sandbox,
      appKey: 'yout-app-key',
      countries: ['AE'],
      isExperimental: true,
      onSuccess: (d) => console.log(d),
      onFailure: (e) => console.log(e),
    });
    setTimeout(() => {
      handler.open();
    }, 5000)
  </script>
</body>
</html>

If authentication is completed successfully you will receive following parameters in the response:

Parameter

Type

Description

success

Boolean

Status of the authentication request

accessCode

String

Single use, temporary access code that should be exchanged for user token

connectionID

String

Connection identifier.

Is needed to obtain Access Token.

userSecret

String

Encrypted secret of the user.

Is needed in majority of API requests

userID

String

ID of the user.

Is not needed in further API requests

tokenID

String

Token identifier.

Is not needed in further API requests

Example of successful response:

{
    "success": true,
    "accessCode": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzYWx0IjoiRmlHUUhDM2NwZ01NZmhaejNHMk8zNitHakdBUEs0ZFptSEgwRy9jN1cxWT0iLCJhcHBLZXkiOiI0OTc3OTFjZmQ1MTBmMjI1MDc1Yzk3YWNkYzFkYmY0YTI1ZDczNTgxNGZlMmE3OGQxZjRiMGI4OTcxOGU3ZWQ2IiwidG9rZW5JRCI6IjA2ZWU1OGI5LTIxYjQtNGZmYy1hYTliLTA5Y2I4MGU1YjllMiIsImlhdCI6MTYxNzA0NTc4OSwiZXhwIjoxNjE3MDQ2MDg5fQ.8lX4IRL1IxUXuQ5DT7J6Afy_5f35VribFHWpPOzVwlg",
    "userSecret": "t1fcWW3IXbzsMYdMNlr6m6E6N75WFcaaVjsMiqUieBnbmGUoUJv5O/0Zy2WwwiNKUPGmIUTa64QIxmIkG/CjIfOSe5H0ZY7XMRwNao/qqDUIlY//viU2eAyihm4x5bkiwzQ2/pg7TaQatGLv/bX0oBCOmNNf2teoT8fIHHcfVzhZCyfsWoqrA8wM0tD0UgybqK/QQcfos589TpIZ9M32Ibm0loupK8y+xWVoBE88FTp2ovqoGF0jvR39oy9FL/P3lVNWxsd/r9fGq2zn9DeUjZKRlhYeudHxDlyQbyfYQUzusY8pS1I34Yt4GMwICQbKxZINO4nkcgajlbt8/Iykkq7cEOywiOAMsjQ0pmf6SN+wn2m42FWknIzwSA7enMJn3DoPrtCzZq99E04m2Y5YRhJ2glUlbZ+4SQPlskzoOkmV6kOumBl3cEIEV0Q0NIGyA6gvBumEMJBrk7SpL27HVoFvMAdsAHtxz8PejXg1hNgxuBIFocsJeOZNq5dXALAMZzUDUl5/SlCMWms3tlUPusrWKjkKr7eOQ/HpXlauluGGq5NN03cLBaGinyVBmGWiDqgJi6IzLYrrmeB1QJzYOCg+e/JFQ54/EwfaMTB7vupkIpkHmKlu2SP83RwQ3ZMsnr+Nvun32sAKCBHB70Jq2+0WWCFUzTHZ3QIBeb/LRwg=",
    "connectionID": "5ccf46f5fa3fb1cd3e80659482e7ca57c5dcf223",
    "userID": "JXSgn+/uCdNLBnHBdtXBVAg8sBHH37rOfBjGsmfFXvbP9AjSeGzriE+C7vN2TgKoI1g69lIw4Bbq7ejaA6UMrg==",
    "tokenID": "06ee58b9-21b4-4ffc-aa9b-09cb80e5b9e2"
}

Updated 2 months ago

Connect Layer - Quickstart


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.