Getting Started with Sharmo API

A step-by-step guide to integrating with the Sharmo real estate tokenization platform

Introduction

Welcome to the Sharmo API documentation! This getting started guide will walk you through the basic steps to integrate your application with the Sharmo real estate tokenization platform. By the end of this guide, you'll have a clear understanding of how to authenticate, make API calls, and leverage our SDKs for faster development.

Note:

This guide assumes you have basic familiarity with RESTful APIs and at least one programming language (JavaScript, Python, or similar). If you need more detailed information about specific endpoints, refer to our API Reference.

Prerequisites

Before you begin integrating with the Sharmo API, make sure you have the following:

  • A Sharmo developer account (sign up at developers.sharmo.io)
  • Basic understanding of HTTP requests and RESTful APIs
  • Familiarity with your programming language of choice
  • A working development environment with internet access

Platform Registration

1
Create a Developer Account

Visit developers.sharmo.io and sign up for a developer account. You'll need to provide basic information about yourself and your company.

2
Register Your Application

Once you've created an account, log in to the Developer Console and go to "Applications" → "Register New Application." Provide the following information:

  • Application name
  • Description
  • Redirect URIs (for OAuth authentication)
  • The type of application (web, mobile, or server)
3
Get Your API Credentials

After registering your application, you'll receive the following credentials:

  • Client ID: Identifies your application to the Sharmo API
  • Client Secret: Used to authenticate your application (keep this secure!)
  • API Key: For simple API authentication flows

Store these credentials securely. Never expose them in client-side code or public repositories.

Authentication

Sharmo API uses OAuth 2.0 for authentication. There are several authentication flows available depending on your application type. For detailed information, see our Authentication Guide.

Simple Authentication with API Key

For testing and simple server-to-server integrations, you can use API key authentication:

HTTP Request with API Key

// JavaScript example
const response = await fetch('https://api.sharmo.io/v1/properties', {
  method: 'GET',
  headers: {
    'X-API-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
});

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

OAuth 2.0 Authentication

For production applications, especially those that access user data, use OAuth 2.0:

Obtaining an Access Token

// JavaScript example
const response = await fetch('https://api.sharmo.io/v1/auth/token', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    grant_type: 'client_credentials',
    client_id: 'YOUR_CLIENT_ID',
    client_secret: 'YOUR_CLIENT_SECRET'
  })
});

const authData = await response.json();
const accessToken = authData.access_token;

// Now use the access token for API calls
const apiResponse = await fetch('https://api.sharmo.io/v1/properties', {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${accessToken}`,
    'Content-Type': 'application/json'
  }
});

Your First API Call

Let's make a simple API call to retrieve a list of available properties:

Get Properties List

// JavaScript example
async function getProperties() {
  try {
    // First get an access token
    const tokenResponse = await fetch('https://api.sharmo.io/v1/auth/token', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        grant_type: 'client_credentials',
        client_id: 'YOUR_CLIENT_ID',
        client_secret: 'YOUR_CLIENT_SECRET'
      })
    });
    
    const tokenData = await tokenResponse.json();
    const accessToken = tokenData.access_token;
    
    // Now use the token to get properties
    const propertiesResponse = await fetch('https://api.sharmo.io/v1/properties?limit=10', {
      method: 'GET',
      headers: {
        'Authorization': `Bearer ${accessToken}`,
        'Content-Type': 'application/json'
      }
    });
    
    const properties = await propertiesResponse.json();
    console.log('Properties:', properties);
    return properties;
  } catch (error) {
    console.error('Error fetching properties:', error);
  }
}

// Call the function
getProperties();

Python Example

Get Properties List (Python)

import requests

def get_properties():
    try:
        # First get an access token
        token_response = requests.post(
            'https://api.sharmo.io/v1/auth/token',
            json={
                'grant_type': 'client_credentials',
                'client_id': 'YOUR_CLIENT_ID',
                'client_secret': 'YOUR_CLIENT_SECRET'
            }
        )
        token_data = token_response.json()
        access_token = token_data['access_token']
        
        # Now use the token to get properties
        properties_response = requests.get(
            'https://api.sharmo.io/v1/properties',
            params={'limit': 10},
            headers={
                'Authorization': f'Bearer {access_token}',
                'Content-Type': 'application/json'
            }
        )
        
        properties = properties_response.json()
        print('Properties:', properties)
        return properties
    except Exception as e:
        print(f'Error fetching properties: {e}')
        return None

# Call the function
get_properties()

Using Sharmo SDKs

To simplify API integration, we provide SDKs for popular programming languages. These SDKs handle authentication, error handling, and provide a more intuitive interface for interacting with the API.

JavaScript SDK

Install and use the JavaScript SDK

// Install via npm
// npm install sharmo-sdk

import { SharmoClient } from 'sharmo-sdk';

// Initialize the client
const sharmo = new SharmoClient({
  clientId: 'YOUR_CLIENT_ID',
  clientSecret: 'YOUR_CLIENT_SECRET',
  environment: 'sandbox' // or 'production'
});

// Get properties (the SDK handles authentication for you)
async function getProperties() {
  try {
    const properties = await sharmo.properties.list({
      limit: 10,
      status: 'active'
    });
    
    console.log('Properties:', properties);
    return properties;
  } catch (error) {
    console.error('Error fetching properties:', error);
  }
}

getProperties();

Python SDK

Install and use the Python SDK

# Install via pip
# pip install sharmo-sdk

from sharmo.client import SharmoClient

# Initialize the client
client = SharmoClient(
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
    environment="sandbox"  # or "production"
)

# Get properties (the SDK handles authentication for you)
def get_properties():
    try:
        properties = client.properties.list(
            limit=10,
            status="active"
        )
        
        print(f"Retrieved {len(properties)} properties")
        return properties
    except Exception as e:
        print(f"Error retrieving properties: {e}")
        return []

# Call the function
get_properties()

For more detailed information about our SDKs, see the SDK Documentation.

Next Steps

Now that you've made your first API call, you're ready to explore more advanced features of the Sharmo platform. Here are some recommended next steps:

Need Help?

If you encounter any issues or have questions, our developer support team is here to help. Contact us at dev-support@sharmo.io or visit our support portal.