Overview
This guide explains how to get started with using the Wallet-as-a-Service (WaaS) 2.0 API. By the end of this guide, you will be able to successfully call an API operation and receive a response.Before you begin
If you choose to use a WaaS SDK instead of manually writing the API requests, you need to first install the right version of the corresponding programming language. For example, if you want to use the Python SDK, you need to have Python 3.7 or a newer version installed.Set up an account
Follow the instructions in Set up your account and organization to set up your Cobo account and create your organization. If an organization has already been set up, ask your organization admin to invite you to join the organization.This guide uses the development environment in all of its examples. Please create your organization in the development environment at https://portal.dev.cobo.com/.
Generate an API key and an API secret
Generate an Ed25519 key pair as the API key and API secret. This guide uses OpenSSL as an example. To learn other methods for generating an API key and an API secret, see Generate an API key and an API secret.- In a terminal window, run the following OpenSSL commands:
private.key.pem
file, and the public key is saved in the public.key.pem
file.
- You can print the keys by running the following commands:
Register the API key
Register your API key and configure related permissions on Cobo Portal. To learn more about registering an API key, see Register an API key.- Log in to Cobo Portal (development environment).
- On the left navigation menu, click Developer > API Keys.
- Click Register API Key.
- Enter the API key name (maximum 30 characters).
- Enter the public key you have generated in the previous step.
- Under Role & Wallet Scope, set Viewer as the user role and All Wallets as the wallet scope. Each user role is permitted to call a specific set of operations, and the wallet scope determines the set of wallets this API key can access.
- Click Confirm to save the changes.
- Select Temporary as the key type. If you already have a static IP address, you can select Permanent as the key type instead and enter your IP address in IP Whitelist.
- Click Register.
- Notify your organization admins to approve the request on Cobo Guard.
By default, it requires the approval of at least half of the admins to successfully register an API key.
Authenticate your requests
You can skip this step if you choose to use a WaaS SDK, which encapsulates the authentication mechanism.
- Biz-Api-Key: The API key. To learn how to generate an API key, see Generate an API key and an API secret.
- Biz-Api-Nonce: A nonce is the current time in Unix timestamp format, measured in milliseconds.
- Biz-Api-Signature: The API signature. To learn how to calculate an API signature, see Calculate an API Signature.
Send a request
You can skip this step if you choose to use a WaaS SDK, which offers ready-to-use functions that handle the API integration using the programming language of your project.
Use a WaaS SDK
This section introduces how to use the Python SDK to call an API operation instead of manually writing the request. To learn how to install the Python SDK and complete the initial setup, refer to Get started with Python SDK. The following is the sample code for calling the List supported chains operation. When configuring the HTTP host, please use the URL of the development environment because you have registered the API key in the development environment in the previous step.What’s next
You have successfully sent an API request and received a response. However, there are still a few things to do before you can create a wallet, make a transaction, or implement other features.- To start using a wallet, you must purchase a pricing plan or activate a trial plan if it is available. To learn about pricing plans and bills and payments, refer to Introduction to Bills & Payments.
- To withdraw tokens from your wallet, you must first set up a callback endpoint to receive and approve withdrawal requests. It is highly recommended that you also set up a webhook endpoint to receive real-time notifications regarding transaction status updates and other events of your concern. To learn how to set up and register webhook and callback endpoints, refer to Introduction to webhooks and callbacks.
See also
- To learn what Cobo Portal has to offer, including how to choose from the four wallet technologies, refer to Introduction.
- To learn the specifics of the WaaS 2.0 API, see API References or download the WaaS 2.0 API specification from GitHub.
- To learn the complete process of creating and interacting with Custodial Wallets (Asset Wallets), see Get started with Custodial Wallets (Asset Wallets).
-
To learn where to view API-related data and logs, see Introduction to Developer Console.
Feel free to share your feedback to improve our documentation!