Webhooks

book reader icon
3 Minutes
facebook logo gray
linkedin logo gray
mail logo gray
Webhooks

What is a webhook?

With Webhooks you can send event based information to a customized URL. When an event e.g. QR_CODE_SCANNED occurs, your given URL will be called (webhooked).

Webhooks are only available with our White Label plan.

How do I create a webhook?

When logged in as an administrator from the White Label Platform, edit a user and go to the Webhooks section. There you can set a destination URL for each event.

What events trigger a webhook?

There are many different events on the platform where a webhook can be triggered.

EventTriggered
QR_CODE_CREATEDwhen a QR Code has been generated
QR_CODE_SCANNEDwhen a QR Code has been scanned
VOUCHER_CREATEDwhen a Voucher has been created
VOUCHER_UPDATEDwhen a Voucher has been updated
VOUCHER_REDEEMEDwhen a Voucher has been redeemed
VOUCHER_EXPIREDwhen a Voucher has been expired
LEAD_CREATEDwhen a Lead has been created
CALL_2_ACTION_BUTTON_CLICKEDwhen a Call-2-Action Button was clicked
JOB_FINISHEDwhen a bulk designer QR Code process is finished

What parameters does a webhook send along?

A webhook URL is called depending on the event with certain parameters that are wrapped in a POST request.

Standard parameters

The following parameters are always sent along in a webhook.

ParameterDescription
eventThe name of the event e.g. QR_CODE_SCANNED
timestampThe time when the event occurred
userThe user who created the QR Code
codeThe short URL from the QR Code
secrettokenThe secret API key from the user API. You can use this key to verify a webhook request is from your account.

QR Code was scanned

These parameters are additionally sent along if a QR Code was scanned.

ParameterDescription
redirectsThe number of times a QR Code was scanned
visitorsThe number of unique visitors who scanned the QR Code
deviceThe device that scanned the QR Code
osThe operating system that scanned the QR Code
countryThe country where the QR Code was scanned
lng/latAn optional location information with a lng/lat pair if a user sends along his GPS data.

QR Code was updated

These parameters are additionally sent along if the target URL of QR Code is updated.

ParameterDescription
urlNew target URL of the updated QR Code
uniqevisitors
Unique visitors
redirect
Number of redirects
title
Title of the QR Code
description
Description field of the QR Code
Type
URL, BUSINESS_CARD, PRODUCT, OPENIMMO, COUPON, PLAIN, LEAD, SOCIAL,TRACING
Subtype
URL, FACEBOOK_PAGE, FACEBOOK_LIKE, INSTAGRAM, SKYPE, APPSTORE, YOUTUBE, TWITTER, LINKEDIN, SMS, EMAIL, TEXT, VCARD, WLAN, GEO, PAYPAL, PINTEREST, EVENT, PHONE, SEPA, MULTI, BITCOIN, VOUCHER, WHATSAPP, PDF, MULTI_LANGUAGE, MP3, MULTI_GEO, MULTI_GEO_CLOSEST, UNLIMITED, UNIQUEIP, UNIQUEID, ONE, GS1
Creation dateQR Code creation date

Coupon was updated

These parameters are additionally sent along when a voucher has been updated.

ParameterDescription
titleThe title of the voucher
descriptionThe description of the voucher
The type of voucher
typeThe type of voucher
UNIQUEIP - Voucher can be redeemed once per IP
UNIQUEID  - Voucher can be redeemed once
productnameAn optional product name for the voucher
websiteAn optional web page to which the voucher links
couponnumberAn optional voucher number that will be displayed on the voucher
validfromAn optional date from when the voucher is valid
validtoAn optional date from when the voucher expires

Voucher was redeemed

These parameters are additionally sent when a voucher has been redeemed.

ParameterDescription
statusStatus of redemption:
SUCCESSVoucher was redeemed
VOUCHER_ALREADY_REDEEMEDVoucher was already redeemed before
VOUCHER_EXPIREDVoucher has expired
QUOTA_EXCEEDEDThe limit of redemptions was exceeded
typeThe voucher type:
UNIQUEIPVoucher can be redeemed once per IP
UNIQUEIDVoucher can be redeemed once
eancodeIf the voucher is redeemed and an EAN barcode is set, the EAN code will be transmitted in the webhook.
uniqueidIf the QR Code is a one-time redeemable voucher, the unique ID of the voucher is returned. This is one of the unique IDs when you create bulk QR Codes for a uniquely redeemable voucher.

New lead

These parameters are additionally sent when a new lead is generated.

ParameterDescription
emailThe email address of the new lead
nameThe name of the new lead

C2A-button was clicked

This parameter is also sent when a Call-2-Action button is clicked.

ParameterDescription
c2aThe URL of the Call-2-Action button Lorem

Job was finished

This parameter is additionally sent along when a job that provides designer QR Codes for download is finished with the calculation.

ParameterDescription
downloadA link to download the job result that is valid for 30 days

Webhook logs

You can check the logs from your user settings to see which webhooks, when have been fired and if there has been any error.

Debugging

If you want to output the information sent to your server on a webhook, use the following PHP script to display all parameters:

<?php

    // Test WebHook and show parameters

    error_log("Fired WebHook");

    // Post Parameter 
    foreach ($_POST as $param_name => $param_val) {
        error_log("$param_name: $param_val");
    }
    
    // Get Parameter 
    foreach ($_GET as $param_name => $param_val) {
        error_log("$param_name: $param_val");
    }
    
    // if JSON submitted
    $json = json_decode(file_get_contents('php://input'));

Test a webhook online

With the free webhook.site service you can immediately test a webhook online.

Copy a webhook setup to another user profile

The Administrator API allows you to copy a webhook setup from one user profile to another.

Last update 2 months ago