Profiles routes

Profiles play a central role, acting as the core for wallets, addresses, and transactions. When integrating a user into your system for blockchain interaction, having a wallet is key.

Profiles establish a direct link between your system's users and their corresponding wallets in ours. Creating a profile involves sending the user type and a reference, such as a UUID or email. This reference is necessary for tasks like generating addresses and handling transactions.

Everything starts with creating profile

Here are routes for profile management.

Create a profile

Make sure that you created an API Key from our dashboard, to start creating a profile

This operation creates a profile

POST https://sandbox.oumla.com/api/v1/profiles

Headers

Request Body

Sample code of the request:

async function createProfile(reference: string, type: string) {
  const apiKey = "Your API Key";
  const url = "https://sandbox.oumla.com/api/v1/profiles";

  const data = JSON.stringify({ reference, type });

  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
createProfile("dba1fea5-2004-4ea8-a06d-a7c7c5559b8f", "User");

The expected response:

{
    "message": "Profile created",
    "profile": {
        "reference": "dba1fea5-2004-4ea8-a06d-a7c7c5559b8f",
        "type": "User"
    }
}

Get Profiles

This operation gets a profile

GET https://sandbox.oumla.com/api/v1/profiles

Query Parameters (Optional)

Headers

Sample code of the request:

async function getProfiles() {
  const apiKey = "Your API Key";
  const url = "https://sandbox.oumla.com/api/v1/profiles";

  const response = await fetch(url, {
    method: "GET",
    headers: {
      "x-api-key": apiKey,
    },
  });

  if (!response.ok) {
    throw new Error(`Error fetching data: ${response.status}`);
  }

  const data = await response.json();
  console.log(data);
}

// Example usage
getProfiles();

The expected response:

{
    profiles: [
        {
            createdAt: '2024-01-17T09:32:29.546Z',
            updated_at: '2024-01-17T09:32:29.546Z',
            organizationId: '89a695b9-4c5f-4130-8b56-aff8010f8103',
            type: 'User',
            label: null,
            reference: 'dba1fea5-2004-4ea8-a06d-a7c7c5559b8f',
            miniWallets: [Array],
            bitcoin_balance: [Object],
            addressesCount: 0
        },
     // and the other profiles ...
    ], 
    skip: 0,
    take: 10,
    totalElements: 1,
    totalPages: 1
}

Last updated