Create an endpoint
Choose a server environment that supports receiving and processing HTTP POST requests, such as a cloud service like AWS or Google Cloud, or a self-hosted server. Define an endpoint URL on your server where Cobo will send callback messages.Implement handling logic
After you create the endpoint, implement the logic on your server to handle callback messages.Parse the callback request
Cobo sends an HTTP POST request to your registered callback endpoint. The request body is the transaction object and contains the following fields:Verify the signature
To prevent unauthorized access, verify the authenticity of each callback request by checking its signature. The verification steps are as follows:-
Retrieve the raw body and timestamp.
Extract the original body string from the request payload and the timestamp from the request headers.
-
Retrieve the signature.
Fetch the signature value from the request header.
-
Concatenate and hash the message.
-
Select Cobo’s public key.
Depending on the environment you use, select the corresponding public key for verification:
- Development environment:
a04ea1d5fa8da71f1dcfccf972b9c4eba0a2d8aba1f6da26f49977b08a0d2718 - Production environment:
8d4a482641adb2a34b726f05827dba9a9653e5857469b8749052bf4458a86729
- Development environment:
-
Verify the signature using the Ed25519 algorithm.
Respond to the callback request
Your endpoint must respond within 10 seconds. Return a JSON body with aresult field:
-
To approve the operation:
-
To deny the operation:
Failed.
Register the endpoint
You register a callback URL when creating an API key in Cobo Portal. The callback URL is associated with the API key and Cobo sends callback messages to it for all operations initiated using that API key.- Go to Cobo Portal > Developer > API Keys.
- Click Register API Key.
- In the Callback URLs section, click Add Callback URLs.
- Enter your endpoint URL and an optional description.
- Click Register to save the callback URL.
- Click Register Key to complete the API key registration.
- Without a callback URL, all withdrawal requests are auto-approved.
- All configured callback URLs must return
okfor a request to proceed. Any URL returningdenyimmediately blocks the transaction. - You can associate up to 3 callback URLs with a single API key.
