Webhooks in Heights Platform
Webhooks allow Heights Platform to send automated notifications directly to external services whenever certain events occur within your account. Instead of repeatedly checking (polling) for updates, webhooks instantly send information to your chosen destination (target URL).
If you are using automation tools like Zapier, Pabbly Connect, or Integrately, you can directly connect them to your Heights account without needing webhooks. However, webhooks are particularly useful for direct integrations where no automation tool is involved or when the automation tool you're using supports webhooks specifically.
How Do Webhooks Work?
When you subscribe to webhook events in Heights Platform, you provide a "target URL"—the specific location where you want event data sent. Once set up, every time the subscribed event happens (like a new student enrolling or a student completing a course), Heights Platform automatically sends relevant data to your target URL in real-time.
Example Use Cases
- Automatically enroll students in email marketing workflows after they sign up.
- Track student progress externally and update analytics dashboards.
- Real-time updates of new orders or student achievements.
By setting up webhooks, you can integrate Heights Platform seamlessly with other services and automate your workflow efficiently.
Setting Up Webhooks
You have two options to set up webhooks:
Option 1: Using Heights Platform Integration UI (Recommended for Beginners)
The easiest way to configure webhooks is through the integrations area of your Heights Platform account. Navigate to your account settings page, select the integrations tab, and find webhooks in the integration list. Here, you can enter the target URL provided by your external service and select the event you want to subscribe to directly from the user interface. This method does not require any manual API calls and is the most user-friendly approach.
Option 2: Manual Setup via API
For advanced users, manual setup involves using API calls:
You'll need:
- Your API key (available in your account settings).
- A target URL (provided by the external service you're integrating with).
- The subdomain of your Heights Platform account.
Here's the manual setup process:
Make a POST request to subscribe:
POST https://yoursubdomain.heightsplatform.com/api/hooks { "target_url": "https://your-webhook-url.com", "event": "new_student" // replace with your chosen event }
You will receive a unique ID for this subscription.
- To unsubscribe from an event:
DELETE https://yoursubdomain.heightsplatform.com/api/hooks/{subscription_id}
Available Webhook Events and Example Data
Below are the webhook events you can subscribe to, along with example data sent in JSON format:
New Order (new_order
)
Triggered when an order is marked as paid.
Example JSON payload:
{ "id": "order_12345", "amount": 49.99, "currency": "USD", "description": "Purchase of Course X", "user_email": "john@example.com", "user_name": "John Doe", "user_first_name": "John", "user_last_name": "Doe", "status": "paid", "affiliate_id": "affiliate_123", "courses": [ {"id": 1, "title": "Course X"} ], "digital_products": [ {"id": 2, "name": "Digital Product Y"} ], "bundles": [ {"id": 3, "title": "Bundle Z"} ], "created_at": "2023-03-01T12:00:00Z", "updated_at": "2023-03-01T12:30:00Z" }
New Student (new_student
)
Triggered when a new student enrolls.
Example JSON payload:
{ "id": 789, "name": "Jane Doe", "email": "jane.doe@example.com" }
Student Completed Program (student_completed
)
Triggered when a student completes the entire program.
Example JSON payload:
{ "id": 789, "name": "Jane Doe", "email": "jane.doe@example.com" }
Course Completed (course_completed
)
Triggered when a student completes a specific course.
Example JSON payload:
{ "id": 789, "name": "Jane Doe", "email": "jane.doe@example.com", "course": "Course X", "course_id": 1 }
New Answer (new_answer
)
Triggered when a student posts a new answer.
Example JSON payload:
{ "id": 789, "name": "Jane Doe", "email": "jane.doe@example.com", "answer": "This is my answer to the question.", "question": "What did you learn today?", "lesson": "Lesson Title Here" }
New Project Post (new_project_post
)
Triggered when a student submits a new project post.
Example JSON payload:
{ "id": 789, "name": "Jane Doe", "email": "jane.doe@example.com", "post": "My First Project Post" }