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 Quick start guide 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
Use either OpenSSL or the Python library to generate an Ed25519 key pair. This guide uses OpenSSL as an example. To learn more about generating an API key, see Generate an API key.- 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 User Roles, select API_Viewer. Each user role is permitted to call a specific set of operations.
- Under Wallets, select Any Wallets. This selection determines the wallets this API key has control over.
- 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 the textbox.
- 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. You can only start using an API key after its status becomes Active.
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 public key you generate in Generate an API key.
- 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.
