Skip to main content

Overview

Journium provides both client-side SDK methods and server-side REST API endpoints to help you integrate conversion tracking and analytics into your applications. This reference covers all available methods, parameters, and response formats.

SDK vs REST API

SDK Methods

The Journium SDK provides the following core methods:

Tracking Methods

  • Journium.init() - Initialize the SDK
  • Journium.track() - Track custom events
  • Journium.page() - Track page views
  • Journium.identify() - Identify users
  • Journium.updateUser() - Update user properties

Utility Methods

  • Journium.ready() - Wait for SDK initialization
  • Journium.reset() - Clear all data
  • Journium.getConfig() - Get current configuration
  • Journium.isReady() - Check if SDK is ready

Authentication

All API requests require authentication using your project’s API key. You can find your API key in your Journium dashboard.

SDK Authentication

The SDK uses your public API key for client-side tracking:
Journium.init({
  projectId: 'your-project-id',
  apiKey: 'your-public-api-key', // Safe to expose in client-side code
  environment: 'production'
});

REST API Authentication

Server-side API requests use your secret API key in the Authorization header:
curl -H "Authorization: Bearer your-secret-api-key" \
     -H "Content-Type: application/json" \
     https://api.journium.com/v1/events
Keep your secret API key secure and never expose it in client-side code. Use environment variables to store sensitive keys.

Rate Limits

To ensure fair usage and optimal performance, the Journium API implements rate limiting:
  • SDK Events: 1,000 events per minute per project
  • REST API: 100 requests per minute per API key
  • Bulk Operations: 10 requests per minute for batch endpoints
Rate limit headers are included in all API responses:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1640995200

Error Handling

All API endpoints return standard HTTP status codes and error messages:

Success Codes

  • 200 - OK: Request successful
  • 201 - Created: Resource created successfully
  • 202 - Accepted: Request accepted for processing

Error Codes

  • 400 - Bad Request: Invalid parameters or request format
  • 401 - Unauthorized: Invalid or missing API key
  • 403 - Forbidden: Insufficient permissions
  • 404 - Not Found: Resource not found
  • 429 - Too Many Requests: Rate limit exceeded
  • 500 - Internal Server Error: Server-side error

Error Response Format

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

SDKs and Libraries

API Versioning

The Journium API uses URL versioning. The current version is v1:
https://api.journium.com/v1/
When we release new API versions, previous versions will be supported for at least 12 months to ensure backward compatibility.

Changelog

Stay updated with the latest API changes:
  • v1.2.0 (2024-01-15): Added bulk event tracking
  • v1.1.0 (2023-12-01): Enhanced error responses
  • v1.0.0 (2023-10-15): Initial API release

Getting Help