Legion Hand Technologies Logo

Developer Portal

v1.0.0

Getting Started with User-X API

Welcome to the User-X Developer Portal! This guide will help you get started with integrating the User-X platform into your applications.

Quick Start

1. Get Your API Credentials

First, you'll need to obtain your API credentials:

  1. Sign up for a User-X developer account
  2. Create a new application in the dashboard
  3. Copy your API key and secret

2. Authentication

User-X supports multiple authentication methods:

JWT Token Authentication

For user-specific operations:

Authorization: Bearer <jwt_token>

API Token Authentication

For server-to-server communication:

Authorization: Bearer <api_token>

3. Make Your First API Call

Here's a simple example to get active opportunities:

const response = await fetch('https://api.user-x.com/api/opportunities', {
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  }
});

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

4. Set Up Webhooks

Configure webhook endpoints to receive real-time notifications:

# Environment variables
VERIFICATION_WEBHOOK_URL=https://your-domain.com/webhooks/verification
VERIFICATION_WEBHOOK_SECRET=your-secure-secret

5. Test in Sandbox

Use our sandbox environment for testing:

  • Sandbox URL: https://sandbox-api.user-x.com
  • Test Data: Pre-populated with sample opportunities and users
  • No Rate Limits: Perfect for development and testing

Core Concepts

Opportunities

Campaigns or challenges that users can participate in. Each opportunity contains multiple tasks.

Tasks

Individual actions within an opportunity that users need to complete.

Claims

When a user decides to participate in an opportunity, they create a claim.

Verifications

Proof submissions that users provide to show they've completed a task.

Rewards

Benefits earned when users successfully complete all tasks in an opportunity.

Next Steps

  1. API Reference - Explore all available endpoints
  2. Webhooks - Set up real-time notifications
  3. Integration Guide - Detailed integration examples
  4. Architecture - Understand the system design

Support

Need help? Here are your options:

  • Documentation: Browse our comprehensive guides
  • GitHub Issues: Report bugs or request features
  • Community Forum: Connect with other developers
  • Email Support: [email protected]

Rate Limits

API requests are subject to rate limiting:

  • Authenticated requests: 1000 requests per hour
  • Unauthenticated requests: 100 requests per hour
  • Webhook deliveries: No limits

Rate limit headers are included in all responses:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1640995200

SDKs and Libraries

Official SDKs are available for popular programming languages:

  • JavaScript/Node.js: npm install @user-x/sdk
  • Python: pip install user-x-sdk
  • PHP: composer require user-x/sdk
  • Ruby: gem install user_x

Error Handling

The API uses conventional HTTP response codes:

  • 200: Success
  • 400: Bad Request - Invalid parameters
  • 401: Unauthorized - Invalid or missing authentication
  • 403: Forbidden - Insufficient permissions
  • 404: Not Found - Resource doesn't exist
  • 429: Too Many Requests - Rate limit exceeded
  • 500: Internal Server Error - Something went wrong on our end

Error responses include detailed information:

{
  "error": {
    "code": "invalid_request",
    "message": "The request is missing required parameters",
    "details": {
      "missing_fields": ["taskId", "claimId"]
    }
  }
}