This website uses necessary cookies to ensure that our website is ideally usable. We do not use cookies that process personal data without your prior consent. Read our Cookie Policy

Ganci web

book reader icon
3 Minuti
facebook logo gray
linkedin logo gray
mail logo gray

Cosa è un webhook?

Con i Webhook è possibile inviare informazioni basate su eventi a un URL personalizzato. Quando si verifica un evento, ad esempio QR_CODE_SCANNED, l'URL indicato viene chiamato (webhook).

I webhook sono disponibili solo con il nostro piano White Label.

Come faccio a creare un webhook?

Una volta effettuato l'accesso come amministratore dalla White Label Platform, modificare un utente e andare alla sezione Webhooks. Qui è possibile impostare un URL di destinazione per ogni evento.

Quali eventi attivano un webhook?

Ci sono molti eventi diversi sulla piattaforma in cui un webhook può essere attivato.

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

Quali sono i parametri che un webhook invia?

Un URL webhook viene richiamato in base all'evento con determinati parametri che vengono avvolti in una richiesta POST.

Parametri standard

I seguenti parametri sono sempre inviati in un 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.

Il codice QR è stato scansionato

Questi parametri vengono inviati in aggiunta se è stato scansionato un codice QR.

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.

Il coupon è stato aggiornato

Questi parametri vengono inviati anche quando un voucher è stato aggiornato.

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

Il buono è stato riscattato

Questi parametri vengono inviati anche quando un voucher è stato riscattato.

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.

Nuovo lead

Questi parametri vengono inviati anche quando viene generato un nuovo lead.

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

Il pulsante C2A è stato cliccato

Questo parametro viene inviato anche quando viene cliccato un pulsante Call-2-Action.

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

Il lavoro è terminato

Questo parametro viene inviato anche quando un lavoro che fornisce codici QR di designer per il download viene completato con il calcolo.

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

Debugging

Se si desidera visualizzare le informazioni inviate al server su un webhook, utilizzare il seguente script PHP per visualizzare tutti i parametri:

<?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'));

Testare un webhook online

Con il servizio gratuito webhook.site potete testare immediatamente un webhook online.

Copiare una configurazione di webhook in un altro profilo utente

L'API Amministratore consente di copiare un'impostazione di webhook da un profilo utente a un altro.

Last update 11 months ago