Skip to main content
APIXO offers two ways to receive task results: polling (async mode) and webhooks (callback mode). This guide helps you choose the right approach and implement it effectively.

Quick Comparison

When to Use Polling

Choose polling when:
  • Building client-side applications
  • Prototyping or testing
  • You don’t have a public server
  • Processing low volume of tasks

Basic Polling Implementation

Exponential Backoff

For better efficiency, use exponential backoff:

When to Use Webhooks

Choose webhooks when:
  • Running a production server
  • Processing high volume of tasks
  • Need real-time notifications
  • Want to minimize API calls

Webhook Setup

1. Create an endpoint:
2. Submit task with callback:

Webhook Requirements

  • Must be publicly accessible via HTTPS
  • Must respond with HTTP 200 within 30 seconds
  • Should handle duplicate deliveries (use taskId for idempotency)

Retry Policy

If your webhook fails: After 3 failed attempts, the webhook is abandoned. You can still query via the status endpoint.

Hybrid Approach

For maximum reliability, combine both approaches:

Local Development with ngrok

For testing webhooks locally:

Summary

Start with polling for simplicity, then migrate to webhooks as your application scales.