Test your app
Test the app you create to check out Okra's features, and to demo the whole user journey.
Get test credentials
Check out the API Keys page in the Dashboard to retrieve your sandbox credentials.
- The client token is a unique ID that represents you, as a client. You must use it together with your public API key in your Okra app implementation. Client tokens can be used in both Sandbox and Production environments.
- The public API key, along with the client token is used to authenticate your Okra app implementation.
- The secret API key is a JWT bearer token that you must use for authentication on the API level.
Set up the environment
During your integration phase, set up the sandbox environment in these interfaces: the API, your Okra apps, and the dashboard.
In the API
Set your base URL to https://api.okra.ng/v2/sandbox/
. Check out Okra's API environments for more details.
In the embed options
Set the value of env
to production-sandbox
when you build with options
. Learn more about the options that you can use when you embed your app.
Dashboard
In theSelect Test mode in the top right.
Interact with the API
Make sure that you read through the Okra API overview to understand the specifics of interacting with the Okra API, like request and response formats, pagination, and rate limiting.
- Select your Okra Sandbox environment.
- In the Okra API Reference collection, select Bank → Get list of banks.
- Click Send and check the response.
If you set everything up correctly, this endpoint operation returns a list of banks that Okra supports.
Create a test customer
To test how your customer will go through the account connection flow, you need to create a test customer. You can do this in multiple ways:
You can create a customer on the Dashboard. You have the option to manually fill out customer details and define the login credentials, which are needed to go through the account connection flow. You also have the option to autogenerate a customer.
You can also create a customer via the API. You can define customer details manually in your request using the Create customer endpoint operation, and you can leverage the Autogenerate endpoint via the API as well.
When you create customers, the account type you select determines the data set that the API generates. For example, the API only generates BVN and NUBAN values for customers with Personal accounts.
Embed the Okra app
Let's see how you can link a bank account using the sandbox environment, and with test credentials:
- Grab your API key and client token from the Dashboard
- Create an
index.html
file locally and open it in your preferred code editor - Embed this snippet into your
index.html
file, and add your API key and client token in thekey
andtoken
fields:
Web integration sample
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Linking a bank account</title>
</head>
<body onload="buildWithOptions()" style="background-color:#fff;height:100vh">
<script src="https://cdn.okra.ng/v2/bundle.js"></script>
<script type="text/javascript">
function buildWithOptions(){
Okra.buildWithOptions({
name: 'Sandbox Test', // The name of your application or product.
env: 'production-sandbox', // The API environment.
key: '...', // Your public API key.
token: '...', // Your client token.
products: ['auth', 'identity', 'balance', 'transactions' ], // The products that you want to enable.
onSuccess: function(data){
console.log('data', data)
},
onClose: function(){
console.log('close widget')
}
})
}
</script>
</body>
</html>
These are the options that are in the sample snippet:
This sample app uses only the most basic properties. Check out the complete list of App properties for more options.
Connect a bank account
Now open the index.html
in your preferred browser. This initiates the Okra app based on the options in the sample snippet.
The app you created guides you through a workflow according to the products that you defined in the buildWithOptions
snippet. Learn more about the available Okra app flows.
Use the credentials of the test customer that you created to link a bank account. You might also need some of these test credentials:
Test credentials
Check out the data
After you go through the account connection flow, the Okra API immediately starts retrieveing user information. Both in a production environment, and in the Sandbox, this is an async data retrieval process. You can check out the resulting user data in two ways:
- Visit the Records page on the Dashboard to find the customer you connected. The dashboard gives you clear indication about which product's data has been synced already, and which product's data retrieval is still in progress.
- You can also retireve data directly from the API. Visit the API reference to see the different product endpoints, and the specific methods you can use to retrieve data for the products you enabled.
Next steps
When you finish testing your app implementation and feel confident about the results, it's time to discuss going live.
Was this page helpful?