Understanding Webhooks, APIs, and JavaScript Callbacks
Understanding Webhooks, APIs, and JavaScript Callbacks: A Simple Guide
When using Drimify to create interactive experiences, you may want your campaign to "talk" to your other business tools—for example, sending a player's score to your CRM or triggering an email when a game ends.
To do this, there are three main methods: APIs, Webhooks, and JavaScript Callbacks. While they sound technical, they are simply different ways of sharing information.
1. API: The "On-Demand" Request
Think of an API like a waiter in a restaurant. The waiter (the API) sits between you (your system) and the kitchen (Drimify).
- How it works: Your system asks Drimify for specific information, such as "Give me the leaderboard for this game." Drimify then sends that data back to you immediately.
- Best for: When you want to pull specific data into your own dashboard or website whenever you choose.
- Key takeaway: Your system is the one starting the conversation.
2. Webhook: The "Automatic" Notification
A Webhook is like a text message alert from your bank. You don’t have to ask the bank if you have spent money; they tell you the moment it happens.
- How it works: You give Drimify a "destination" (a URL). As soon as a specific event happens—like a user finishing a quiz—Drimify automatically "pushes" that data to your system in real-time.
- Best for: Automating tasks, such as instantly adding a new lead to your mailing list the second they finish an experience.
- Key takeaway: Drimify starts the conversation automatically based on an event.
3. JavaScript Callback: The "Local" Reaction
A JavaScript Callback is a little different because it happens right there on the user's screen (the browser), rather than between two servers behind the scenes.
- How it works: When you embed a Drimify widget on your website, the Callback allows your website to "listen" to what the player is doing inside the game. For example, when the player clicks "Finish," the game tells your website: "They are done!"
- Best for: Changing things on your own website in real-time. For example, you could hide the game and show a "Thank You" message on your webpage, or unlock a hidden download link once the game ends.
- Key takeaway: It happens locally on the user's device to make your website and the Drimify widget work as one.
Which one should I use?
Feature | API | Webhook | JavaScript Callback |
Who starts it? | Your system | Drimify | The User's browser |
When? | Whenever you ask | Immediately after an event | Immediately during the session |
Main Use | Gathering old/bulk data | Automating your CRM/Email | Changing your website live |
Updated on: 17/03/2026
Thank you!
