This guide covers the essential features and best practices of the development portal, designed to help you build your own decentralized applications efficiently and securely.
Creating Your Developer Account
To begin building with the DEX API, you first need to create an account on the developer portal.
- Navigate to the Build section on the main website. Click on the Developer Portal link located in the navigation bar.
- On the portal page, select Connect Wallet. You can use a recommended wallet for a seamless experience or choose any other compatible wallet for your project.
- You will be prompted to verify your session. Click Verify and then confirm the signature request in your wallet extension.
Congratulations! You are now logged into the developer management platform. A default project has been automatically created to help you get started quickly.
Securing Your Account with Contact Information
Linking your email and phone number is a critical security step that also grants you full access to create API keys for your Web3 trading system.
- Locate and click the Link now button, then switch to the Setting tab within your account dashboard.
- Carefully input your email address and phone number. Ensure all information is accurate to avoid verification issues.
Note: If your country does not appear in the phone number selection dropdown, it may be because DEX API services are currently restricted in that region.
- Complete the process by entering the verification codes sent to your email and phone.
You have now successfully secured your account. This allows you to proceed with generating the necessary OKX DEX API keys. For a deeper understanding of security best practices, you can explore more strategies.
Generating Your First API Key
API keys are essential for your application to authenticate and interact with the DEX API.
- Inside your chosen project dashboard, find and click the API keys button.
- Select the Create API key button to initiate the process.
- You will be asked to provide a name for the key and set a secure passphrase. Click Create to generate it.
It is imperative to keep your passphrase safe and accessible. Without it, you will be unable to recover or use your API key.
Managing Your Secret Key
The secret key works in tandem with your API key to sign requests, adding a crucial layer of security.
- After generating your API key, the associated secret key will be displayed.
- Use the Copy button next to it to securely copy the key for your records. This key must be provided alongside your API key when making requests to the API.
Understanding Key Terminology
Familiarize yourself with these general terms to navigate the platform effectively.
- API Key: A unique code that identifies your application or user making a call to the API.
- Secret Key: A security token used with the API key to cryptographically sign requests, ensuring they are authentic and have not been tampered with.
- Passphrase: A user-created password used to encrypt the secret key on the server. It is required to view the secret key and modify any API key information.
Frequently Asked Questions
What is the main purpose of the DEX Developer Portal?
The portal provides developers with a centralized platform to manage their projects, generate API keys, and access documentation. Its primary purpose is to streamline the process of building applications that interact with decentralized exchange protocols.
Why do I need to link both an email and a phone number?
Linking both contact methods significantly enhances the security of your account through two-factor authentication. It is also a mandatory step to gain the permissions required to create and manage API keys for trading systems.
I can't find my country during phone number registration. What should I do?
The unavailability of certain countries is due to regional restrictions on API services. If your country is not listed, you will be unable to access the DEX API services through the portal at this time.
What happens if I lose my API passphrase?
The passphrase cannot be recovered. If you lose it, you will not be able to access your secret key or use that specific API key again. You must delete the old key and generate a new one, then update your application with the new credentials.
Is there a limit to the number of API keys I can create?
Yes, the platform typically imposes limits on the number of active API keys per project to prevent abuse. You can manage and delete unused keys from your project dashboard to free up space for new ones.
How do I ensure my API keys are secure?
Never hardcode keys directly into your application's source code, especially if it is public. Use environment variables or secure secret management services. Regularly rotate your keys and only grant the minimum necessary permissions for your application to function. For implementing these security measures, you can get advanced methods.