For a profile to receive digital assets they need a receiving address. every profile has the ability to get millions of receiving addresses.
Before you create an address, make sure that you create a wallet
Create an address
This operation creates an address
POST
https://sandbox.oumla.com/api/v1/address/
generate
Request Body
Sample code of the request:
async function generateAddress(reference: string, network: string, clientShare: string) {
const apiKey = "Your API Key";
const url = "https://sandbox.oumla.com/api/v1/address/generate";
const data = JSON.stringify({ reference, network, clientShare });
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": apiKey,
},
body: data,
});
const responseData = await response.json();
console.log(responseData);
}
// Example usage
generateAddress("dba1fea5-2004-4ea8-a06d-a7c7c5559b8f","BTC", "Your clientShare")
import axios from "axios";
async function generateAddress(reference: string, network: string, clientShare: string) {
const apiKey = "Your API Key";
const url = "https://sandbox.oumla.com/api/v1/address/generate";
try {
const response = await axios.post(url, {
reference,
network,
clientShare
}, {
headers: {
"x-api-key": apiKey,
"Content-Type": "application/json",
},
});
console.log(response.data);
} catch (error) {
console.error("Error:", error);
}
}
// Example usage
generateAddress(
"dba1fea5-2004-4ea8-a06d-a7c7c5559b8f",
"BTC",
"clientShare"
).catch((error) => console.error("Error:", error));
import requests
import json
url = "https://sandbox.oumla.com/api/v1/address/generate"
api_key = "Your API Key"
data = {
reference: "dba1fea5-2004-4ea8-a06d-a7c7c5559b8f",
network: "BTC",
}
headers = {
"Content-Type": "application/json",
"x-api-key": api_key
}
response = requests.post(url, data=json.dumps(data), headers=headers)
if response.status_code == 201:
print(response.json())
else:
print("Error:", response.status_code, response.text)
The expected response:
{
"message": "bitcoin mainnet address created",
"data": "3Ls73KucJMLsD8Tm6aMzq64SVo32z8Buhi",
"success": true,
"status": 201
}
{
"message": "ethereum mainnet address created",
"data": "0x0A7dfAF8BpAF992161n8552692C644r88bF5b7B5",
"success": true,
"status": 201
}
{
"message": "Profile not found",
"success": false,
"status": 402
}
Get Addresses
This operation to get addresses by Profile
GET
https://sandbox.oumla.com/api/v1/addresses/{{
reference
}}
Query Parameters (required)
Sample code of the request:
async function getAddressByReference(reference: string) {
const apiKey = "Your API Key";
const url = `https://sandbox.oumla.com/api/v1/addresses/${reference}`;
const response = await fetch(url, {
method: "GET",
headers: {
"Content-Type": "application/json",
"x-api-key": apiKey,
},
});
const data = await response.json();
console.log(data);
}
getAddressByReference("89a625b9-4c5f-4130-8b56-afx8010f8103")
import axios from "axios";
async function getAddressByReference() {
const apiKey = "Your API Key";
const url = `https://sandbox.oumla.com/api/v1/addresses/${reference}`;
try {
const response = await axios.get(url, {
headers: {
"x-api-key": apiKey,
},
});
console.log(response.data);
} catch (error) {
console.error("Error:", error);
}
}
// Example usage
getAddressByReference();
import requests
import json
url = f'https://sandbox.oumla.com/api/v1/addresses/{reference}'
api_key = "Your API Key"
headers = {
"Content-Type": "application/json",
"x-api-key": api_key
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
print(response.json())
else:
print("Error:", response.status_code, response.text)
Get Addresses
This operation to get addresses for organization
GET
https://sandbox.oumla.com/api/v1/addresses/
organization
Query Parameters (Optional)
Sample code of the request:
async function getAllAddressed() {
const apiKey = "Your API Key";
const url = `https://sandbox.oumla.com/api/v1/addresses/organization`;
const response = await fetch(url, {
method: "GET",
headers: {
"Content-Type": "application/json",
"x-api-key": apiKey,
},
});
const data = await response.json();
console.log(data);
}
getAllAddressed()
import axios from "axios";
async function getAllAddressed() {
const apiKey = "Your API Key";
const url = `https://sandbox.oumla.com/api/v1/addresses/organization`;
try {
const response = await axios.get(url, {
headers: {
"x-api-key": apiKey,
},
});
console.log(response.data);
} catch (error) {
console.error("Error:", error);
}
}
// Example usage
getAllAddressed();
import requests
import json
url = f'https://sandbox.oumla.com/api/v1/addresses/organization'
api_key = "Your API Key"
headers = {
"Content-Type": "application/json",
"x-api-key": api_key
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
print(response.json())
else:
print("Error:", response.status_code, response.text)
The expected response:
{
addresses: [
{
address: 'tb1q96ljkt664n2gc6ah07m0q9nzfpmzl7kkg409wkvkx9ey8nzf5f3qlcerem',
date: '2024-04-01T10:02:04.521Z',
label: null,
network: 'BTC',
balance: 0,
reference: 'dba1fea5-2004-4ea8-a06d-a7c7c5559b8f'
},
// and the other addresses
],
skip: 0,
take: 10,
totalElements: 1,
totalPages: 1
}
{
"message": "Miniwallets not found",
"success": false,
"status": 402
}