Getting Started
Getting Started
This guide will help you get started with the IPTO API quickly. Follow these steps to set up your development environment and make your first API calls.
Prerequisites
Before you begin, ensure you have:
- A valid email address
- A Solana wallet (for transactions)
- Basic knowledge of REST APIs
- Your preferred programming language
Step 1: Authentication
First, you need to authenticate with the API using the magic link system.
# Request a magic link
curl -X POST https://api.ipto.ai/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]"
}'
Check your email for the magic link and click it to get your access token.
Step 2: Set Up Your Wallet
Add your Solana wallet to your account:
# Add wallet
curl -X POST https://api.ipto.ai/wallet/solana \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"wallet_address": "YOUR_WALLET_ADDRESS",
"network": "solana",
"label": "Primary Wallet",
"is_primary": true,
"signature": "YOUR_SIGNATURE"
}'
Step 3: Deposit Balance
Add SOL to your account balance:
# Deposit SOL
curl -X POST https://api.ipto.ai/balance/deposit \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"amount": 1.0
}'
Step 4: Upload Your First Asset
Create your first asset:
# Upload asset
curl -X POST https://api.ipto.ai/assets \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-F "file=@/path/to/your/file" \
-F "name=My First Asset" \
-F "description=This is my first asset on IPTO" \
-F "is_public=false"
Step 5: Create a MicroIP License
Create a license for your asset:
# Create license
curl -X POST https://api.ipto.ai/microip \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"asset_id": "YOUR_ASSET_ID",
"price": 0.5,
"license_type": "standard"
}'
Quick Start Examples
Python
import requests
# Configuration
API_BASE = "https://api.ipto.ai"
EMAIL = "[email protected]"
ACCESS_TOKEN = "your_access_token"
# Request magic link
response = requests.post(
f"{API_BASE}/auth/login",
json={"email": EMAIL}
)
print("Magic link sent!")
# List assets
response = requests.get(
f"{API_BASE}/assets",
headers={"Authorization": f"Bearer {ACCESS_TOKEN}"}
)
assets = response.json()
print(f"Found {len(assets)} assets")
JavaScript
// Configuration
const API_BASE = "https://api.ipto.ai";
const EMAIL = "[email protected]";
const ACCESS_TOKEN = "your_access_token";
// Request magic link
async function requestMagicLink() {
const response = await fetch(`${API_BASE}/auth/login`, {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({ email: EMAIL })
});
console.log("Magic link sent!");
}
// List assets
async function listAssets() {
const response = await fetch(`${API_BASE}/assets`, {
headers: {
"Authorization": `Bearer ${ACCESS_TOKEN}`
}
});
const assets = await response.json();
console.log(`Found ${assets.length} assets`);
}
Next Steps
- Explore the Authentication guide
- Learn about Assets management
- Understand MicroIP licensing
- Check out Search functionality
- Review Balance management
- Set up Wallet integration
Best Practices
- Store your access token securely
- Implement proper error handling
- Follow rate limiting guidelines
- Use appropriate timeouts
- Validate input data
- Monitor your API usage
- Keep your wallet secure
- Test in sandbox first
Common Issues
Authentication
- Magic link not received
- Token expired
- Invalid credentials
Assets
- File too large
- Invalid file type
- Upload failed
Transactions
- Insufficient balance
- Network errors
- Invalid amounts
Support
If you need help:
- Check the FAQ
- Review Error Handling
- Join our Discord
- Contact support