DapiUS

The DapiUS Developer Hub

Welcome to the DapiUS developer hub. You'll find comprehensive guides and documentation to help you start working with DapiUS as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Exchanging the accessCode for accessToken

📘

Note

To use Dapi's API, you will need software such as Postman. You can find our sample Postman environment here and a sample Postman collection here .

Submit a request to exchange the temporary accessCode for a permanent accessToken in order to perform operations with Dapi for a specific user, such as retrieving data and initiating payments.

  1. Call the following endpoint:
[POST] https://api.dapi.co/v1/auth/ExchangeToken
  1. Enter these parameters in the body of your request (use raw JSON) from the successful login response in Connect:

Parameter

Type

Description

connectionID
REQUIRED

String

ID for a user’s successful log in to Connect.

appSecret
REQUIRED

String

Private token that is generated and available to view only when a new application is first created in the Dashboard.

accessCode
REQUIRED

String

Unique code for a user’s successful login to Connect. Returned in the response of UserLogin.

  1. If the request is successful, you should see the following response:
{
    "success": true,
    "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzYWx0IjoiRmlHUUhDM2NwZ01NZmhaejNHMk8zNitHakdBUEs0ZFptSEgwRy9jN1cxWT0iLCJhcHBLZXkiOiIyZmQ2OTcxN2Y0M2JhMTNkOWM4ZDI5NDY2NzQ0YjVjZTZhNDJiMTQ5YmEwM2I1NTM2Y2ZjMzY2NTg5NzVmNTNlIiwiaWF0IjoxNTg3MDQ0NTgyfQ.pJ-0mnq-7CheSZMkCZnzy56WtAoqPs-8cqWkDwfzXNQ"
}

Alternatively, you might see the following error messages:

{
    "success": false,
    "msg": "Invalid app key or Secret"
}

Verify that you have entered the correct values for the appKey and appSecret as suggested in the steps above.

{
    "success": false,
    "msg": "Invalid/expired token, invalid secret or invalid connectionID"
}

Verify that you have entered the correct values for the accessCode, appSecret, and connectionID.

{
    "success": false,
    "msg": "ConnectionID invalid or already used"
}

You have already used this connectionID to obtain an accessToken. Repeat this request only for a new user or if the user has changed their login details.

Updated 7 months ago

Exchanging the accessCode for accessToken


Suggested Edits are limited on API Reference Pages

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