Skip to main content

Overview

Webhooks (Web Callback, HTTP Push API, or Reverse API) are a method for one web application to transmit messages to the other application in real-time when a predefined event takes place. TagMango's webhooks allow you to receive information about specific events based on parameters of the event.

How Webhooks Work

When an event occurs (like a student reaching 50% course progress), TagMango sends an HTTP POST request to your configured webhook URL with the event data.

Getting Started

  1. Set up a webhook endpoint on your server
  2. Configure the webhook URL with the following register webhook api
  3. Handle the incoming webhook events in your application

Registering webhook

In order to register a webhook on TagMango follow the following steps:

  1. Retrieve your API Key from TagMango dashboard by going to Dashboard -> Platform Integrations (any of them will work).
  2. Use the key to hit the following api endpoint:

To subscribe to this webhook event, configure your webhook endpoint with the following:

curl -X 'POST' \
'https://api-prod-new.tagmango.com/api/v1/integration/webhook/webhook' \
-H 'accept: application/json' \
-H 'x-api-key: <Your API Key>' \
-H 'Content-Type: application/json' \
-d '{
"hookUrl": "<your webhook url>",
"event": "<webhook_event_type>",
"mango": "<mango to be associated> (optional sends all mango related events if not specified)",
"course": "<course to be associated> (optional sends all course related events if not specified)",
"webinar": "<webinar to be associated> (optional sends all webinar related events if not specified)",
"page": "<page to be associated> (optional sends all page related events if not specified)"
}'

Parameters

ParameterTypeRequiredDescription
hookUrlstringYesYour webhook endpoint URL
eventstringYesMust be `<webhook_event_type>`
mangostringNoSpecific mango ID to monitor. If not specified, receives events for all mangoes
coursestringNoSpecific course ID to monitor. If not specified, receives events for all courses
webinarstringNoSpecific webinar ID to monitor. If not specified, receives events for all webinars
pagestringNoSpecific page ID to monitor. If not specified, receives events for all pages

Testing

You can test your webhook implementation using tools like:

Delete Existing Webhook

To delete a webhook, use the following request:

curl -X 'DELETE' \
'https://api-prod-new.tagmango.com/api/v1/integration/webhook/webhook' \
-H 'accept: application/json' \
-H 'x-api-key: <Your API Key>' \
-H 'Content-Type: application/json' \
-d '{
"hookUrl": "<your webhook url>"
}'

Troubleshooting

Common Issues

  1. Webhook not received

    • Check if your endpoint is publicly accessible
    • Verify the webhook URL is correct
    • Ensure your server responds within 30 seconds
  2. Authentication failures

    • Verify API key is correct
    • Check authentication header implementation
  3. Duplicate events

    • Implement idempotency using event-specific identifiers
    • Store processed events to avoid duplicate processing

Support

If you need help with webhook implementation, contact our support team or check the API documentation for more details.