Widget URL
If you want to guide customers to a specific page of Cabital Widget, you need to put the signature in the URL as described below.
The process of creating a signature is as follows:
- Add the required parameters to the widget base URL.
- Add the additional required parameters for the specific feature page according to you want.
- Encrypt the URL (including parameters) with
Secret Key. - Put the result of step 3 with the
signatureparameter at the end of the URL. - Enter this widget URL in the browser.
Step 1: Add the required parameters¶
https://connect.cabital.com/api/v1/partner/link
| Parameter | Required | Description |
|---|---|---|
partner_key |
Yes | Partner's Access Key |
user_ext_ref |
Yes | Customer account ID provided by Partner |
feature |
Yes | Specific feature page
|
Step 2: Add the additional required parameters¶
| Widget | feature |
Required parameter | Optional parameter |
|---|---|---|---|
| Link Account | link |
email: Customer account ID provided by Partner |
redirect_url: Redirected to the partner site immediately after account linked. |
| Onboarding | onboarding |
email: Customer account ID provided by Partner |
redirect_url: Redirected to partner site by clicking button below on Cabital Widget |
| KYC | kyc |
- | - |
| Set up 2FA | 2fa |
- | - |
| Wallet | wallet |
- | - |
| Deposit | deposit |
- |
|
| Buy Crypto | buy |
- |
|
| Convert | convert |
- |
|
| Transfer | transfer |
- |
|
| Transaction List | transaction |
major_ccy: The currency of transaction |
- |
| Transaction Details |
transaction_detail |
txn_id: Transaction ID |
- |
| Withdraw | withdraw |
- |
|
Step 3: Encrypt the URL¶
Encrypt the URL with Secret Key by HMAC-SHA256, and encode the result to URL-encoded format with in Base64.
You can validate the encryption result by using this online tool.
Step 4: Put the signature parameter at the end of the URL¶
e.g. https://connect.cabital.com/api/v1/partner/link?partner_key=ccf290ed-ebee-9f87-4b35-cd1c174c90bf&user_ext_ref=cabital_user_1656048062&redirect_url=https%3A%2F%2Fwww.google.com%2F&feature=link&email=demo@partner.com&signature=0rsN8CSfeRHbaRfuGQeqrIcn%2BkEBzImPsEXihLcuGh4%3D
Example¶
Partner's information
Access Keyisccf290ed-ebee-9f87-4b35-cd1c174c90bfSecret Keyis123(this is a sample, not a real secret key)
Scenario¶
Redirect customer to Google after completing account link on Cabital Widget.
Compose steps¶
-
The base URL of link feature page is :
https://connect.cabital.com/api/v1/partner/link?feature=link&partner_key=ccf290ed-ebee-9f87-4b35-cd1c174c90bf&user_ext_ref=cabital_user_1656048062 -
Add the required parameters according to different feature page, and add the optional parameters as appropriate:
The required parameter of the link feature isemail. If you want to redirect customer to Google after account linking, you have to add the optional parameterredirect_url.https://connect.cabital.com/api/v1/partner/link?feature=link&partner_key=ccf290ed-ebee-9f87-4b35-cd1c174c90bf&user_ext_ref=cabital_user_1656048062&redirect_url=https%3A%2F%2Fwww.google.com%2F&email=demo@partner.com -
After encrypting then encoding the URL, the result is:
0rsN8CSfeRHbaRfuGQeqrIcn%2BkEBzImPsEXihLcuGh4%3D -
Add the encryption result to the end of the URL with the value of the
signatureparameter:https://connect.cabital.com/api/v1/partner/link?partner_key=ccf290ed-ebee-9f87-4b35-cd1c174c90bf&user_ext_ref=cabital_user_1656048062&redirect_url=https%3A%2F%2Fwww.google.com%2F&feature=link&email=demo@partner.com&signature=0rsN8CSfeRHbaRfuGQeqrIcn%2BkEBzImPsEXihLcuGh4%3D