Getting Started
Quick Start Guide
1. Prerequisites
Before you begin, ensure you have:
A BlocWise developer account
API credentials (API key and secret)
Basic understanding of blockchain concepts
2. Make Your First API Call
import requests
# Initialize API client
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
}
# Create a new wallet
response = requests.post(
'https://api.bloclabs.com/v1/wallets/create',
headers=headers,
json={
'network': 'polygon',
'environment': 'testnet'
}
)
print(response.json())
Authentication
Bearer Token Authentication
All API requests must include an Authorization header with a valid Bearer token:
Authorization: Bearer YOUR_API_TOKEN
Token Management
{
"token_types": {
"access_token": {
"expires_in": 3600,
"type": "Bearer"
},
"refresh_token": {
"expires_in": 86400,
"type": "Bearer"
}
}
}
Authentication Flow
Register/Login to obtain tokens
Use access token for API requests
Refresh token when expired
Maintain secure token storage
Base URLs
Production
https://api.bloclabs.com/v1
Production environment
Staging
https://api-staging.bloclabs.com/v1
Staging for testing
Testnet
https://api-testnet.bloclabs.com/v1
Test network environment
API Conventions
Request Format
{
"content_type": "application/json",
"methods_supported": ["GET", "POST", "PUT", "DELETE"],
"pagination": {
"limit": "Number of items per page",
"offset": "Starting position",
"total": "Total number of items"
}
}
Response Format
All responses follow a standard format:
Success Response
{
"status": "success",
"data": {
"wallet_id": "123e4567-e89b-12d3-a456-426614174000",
"address": "0x123...abc"
}
}
Error Response
{
"status": "error",
"message": "Error description",
"errors": [
{
"type": "validation_error",
"message": "Invalid parameter",
"field": "network"
}
]
}
Status Codes
200
Success
400
Bad Request
401
Unauthorized
403
Forbidden
404
Not Found
429
Too Many Requests
500
Internal Server Error
Rate Limits
Default Limits
{
"rate_limits": {
"free_tier": {
"requests_per_minute": 100,
"burst_limit": 150
},
"pro_tier": {
"requests_per_minute": 1000,
"burst_limit": 1500
},
"enterprise_tier": {
"requests_per_minute": "Custom",
"burst_limit": "Custom"
}
}
}
Rate Limit Headers
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1640995200
Handling Rate Limits
Implement exponential backoff
Cache responses when possible
Monitor rate limit headers
Use bulk operations where available
Versioning
API Versions
{
"versions": {
"v1": {
"status": "current",
"released": "2024-01",
"supported_until": "2025-01"
}
}
}
Version Header
Accept: application/json; version=1
Version Lifecycle
Beta: Early access, subject to changes
Stable: Production-ready, fully supported
Deprecated: Scheduled for removal
Sunset: No longer supported
Version Support
Major versions supported for minimum 12 months
Security updates provided for all supported versions
Migration guides provided for version upgrades
Early access to beta versions available for Pro/Enterprise users
Last updated
Was this helpful?