API Reference

Introduction

The Dapi API is an HTTP-based API that can be used to programmatically retrieve data, initiate payments, manage beneficiaries, and perform a variety of other operations.

All methods are invoked by sending a valid JSON request via HTTPS POST. Meaning all the requests, including the ones used to retrieve the data from the API, must use POST verb. All the responses are JSON-encoded and use standard HTTP response codes.

All the requests to the API are passed through https://api.dapi.com host. The API uses resource-based URLs structured in the following format:

1511

API URL Structure

πŸ‘

Pre-Conditions

To start using the Dapi API, first you need to sign up on Dapi Dashboard and generate API keys by creating new app. If you haven't already done this, you can find the how-to guide in Getting your API keys.

API Structure

  • Authentication - Allows you to create new users in DAPI's system, retrieve user access tokens and connect user bank accounts to your application

  • Data - Allows you to access data from your users' bank accounts. Data endpoints can be used to obtain the following financial information about the user:

     - User Identity
     - User Accounts
     - Account Balance
     - Account Transactions
     - User Cards
     - Card Balance
     - Card Transactions 
    
  • Payments - Allows you to perform financial operations on your users behalf. Payments endpoints can be used to:

      - Initiate Payment Transaction
      - Manage Beneficiaries
    
  • Operations - Allows you to check the status of any previous operation (not just transaction status; the endpoint supports status checks for all the operations supported by the API).

  • Metadata - Allows you to obtain metadata information about your users' bank accounts. You can get information like: transfer limits, beneficiary cool down periods, etc.

Bearer Token

Absolute majority of the Dapi API endpoints require user access Token to be specified as Bearer in the Authorization Header.

To read more about how to obtain and use User Token, please refer to Authentication

User Input

Dapi API might require user confirmation to complete the operation. You can consider this similar to 2-step verification. There are 5 types of input that could be requested from the user:

  • otp - This is either the OTP sent to the end user's device by the bank or an in app token in the user's bank app
  • secret_question - A set of questions configured by the end user on a bank account
  • captcha - A captcha shown by the bank
  • pin - Some bank accounts have hardware based device used to generate tokens for some bank operations
  • confirmation - Usually the user needs to open her app on the device to confirm an operation
  • token - An in app token similar to otp

Confirmation can be required by any API endpoint. In other words, no matter which operation you are performing, the API may require confirmation to complete it.

If user input is requested, the response will look something like this:

{
    "operationID": "47204fa6-dca6-44a5-8111-6c6489a232a2",
    "success": true,
    "status": "user_input_required",
    "userInputs": [
    {
      "answer": "",
      "id": "otp",
      "index": 0,
      "query": "Please enter a Smart Pass Token from your ENBD mobile application"
    }
    ]
}

There is no separate endpoint to specify user input. It is sent to the same endpoint where initial request was done. For example:

If request to GetBalance responded with "status": "user_input_required", then the follow-up request, with user input, must be sent to the GetBalance endpoint to continue the operation.

πŸ“˜

Note

The API might require more than one input to be specified at the same time for confirmation. Meaning, the user might be requested to specify OTP and captcha in a single request.

If the user input was valid, the API will return a successful response of the endpoint that requested confirmation. Meaning, after specifying the user input for the GetBalance endpoint, if successful, you will receive the user balance information in the response.

πŸ“˜

Note

The API might request user input several times in a row. In other words, once you submit the user input, the API might follow up with new type of input request before performing the operation.


What’s Next

Now that you are more familiar with the Dapi API you can visit Authentication guide to see how to obtain the user token or you can view common use cases