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

Everything starts with the 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

Name
Type
Description

x-api-key*

string

The API key generated from Oumla's dashboard

Request Body

Name
Type
Description

reference *

string

Any identifer for this user this could be the UUID for the user or profile

type*

ProfileType

One of the profile types. User | Department | Merchant

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)

Name
Type
Description

skip

number

to skip a certain number of rows

limit

number

to get a certain number of rows

Headers

Name
Type
Description

x-api-key*

string

The API key generated from Oumla's dashboard

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