Qu'est-ce qu'un webhook?
Avec les Webhooks, vous pouvez envoyer des informations basées sur des événements à une URL personnalisée. Lorsqu'un événement, par exemple QR_CODE_SCANNED, se produit, l'URL que vous avez indiquée est appelée (webhooked).
-Les webhooks ne sont disponibles qu'avec notre plan White Label plan.
Dans le cadre d'un plan de gestion des codes, il est possible de mettre en place un système de gestion des codes
Quels sont les événements qui déclenchent un webhook?
Il existe de nombreux événements différents sur la plateforme où un webhook peut être déclenché
Event | Triggered |
---|
QR_CODE_CREATED | when a QR Code has been generated |
QR_CODE_SCANNED | when a QR Code has been scanned |
VOUCHER_CREATED | when a Voucher has been created |
VOUCHER_UPDATED | when a Voucher has been updated |
VOUCHER_REDEEMED | when a Voucher has been redeemed |
VOUCHER_EXPIRED | when a Voucher has been expired |
LEAD_CREATED | when a Lead has been created |
CALL_2_ACTION_BUTTON_CLICKED | when a Call-2-Action Button was clicked |
JOB_FINISHED | when a bulk designer QR Code process is finished |
Quels sont les paramètres envoyés par un webhook?
Une URL webhook est appelée en fonction de l'événement avec certains paramètres qui sont enveloppés dans une requête POST
Paramètres standard
Les paramètres suivants sont toujours envoyés dans un webhook
Parameter | Description |
---|
event | The name of the event e.g. QR_CODE_SCANNED |
timestamp | The time when the event occurred |
user | The user who created the QR Code |
code | The short URL from the QR Code |
secrettoken | The secret API key from the user API. You can use this key to verify a webhook request is from your account. |
Le code QR a été scanné
Ces paramètres sont également envoyés si un code QR a été scanné.
Parameter | Description |
---|
redirects | The number of times a QR Code was scanned |
visitors | The number of unique visitors who scanned the QR Code |
device | The device that scanned the QR Code |
os | The operating system that scanned the QR Code |
country | The country where the QR Code was scanned |
lng/lat | An optional location information with a lng/lat pair if a user sends along his GPS data. |
Le code QR a été mis à jour
Ces paramètres sont également envoyés si l'URL cible du code QR est mise à jour.
Parameter | Description |
---|
url | New 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 date | QR Code creation date |
Le coupon a été mis à jour
Ces paramètres sont également envoyés lorsqu'un bon a été mis à jour.
Parameter | Description |
---|
title | The title of the voucher |
description | The description of the voucher |
| The type of voucher |
type | The type of voucher |
| UNIQUEIP - Voucher can be redeemed once per IP |
| UNIQUEID - Voucher can be redeemed once |
productname | An optional product name for the voucher |
website | An optional web page to which the voucher links |
couponnumber | An optional voucher number that will be displayed on the voucher |
validfrom | An optional date from when the voucher is valid |
validto | An optional date from when the voucher expires |
Le bon a été échangé
Parameter | Description | |
---|
status | Status of redemption: | |
| SUCCESS | Voucher was redeemed |
| VOUCHER_ALREADY_REDEEMED | Voucher was already redeemed before |
| VOUCHER_EXPIRED | Voucher has expired |
| QUOTA_EXCEEDED | The limit of redemptions was exceeded |
type | The voucher type: | |
| UNIQUEIP | Voucher can be redeemed once per IP |
| UNIQUEID | Voucher can be redeemed once |
eancode | | If the voucher is redeemed and an EAN barcode is set, the EAN code will be transmitted in the webhook. |
uniqueid | | If 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. |
Nouvelle piste
Parameter | Description |
---|
email | The email address of the new lead |
name | The name of the new lead |
Le bouton C2A a été cliqué
Parameter | Description |
---|
c2a | The URL of the Call-2-Action button Lorem |
Le travail est terminé
Ce paramètre est également envoyé lorsqu'un travail qui fournit des codes QR de concepteur à télécharger est terminé avec le calcul.
Parameter | Description |
---|
download | A link to download the job result that is valid for 30 days |
Les logs du webhook
Vous pouvez consulter les journaux à partir de vos paramètres utilisateur pour voir quels webhooks, quand ont été déclenchés et s'il y a eu une erreur.
Débogage
Si vous souhaitez afficher les informations envoyées à votre serveur sur un webhook, utilisez le script PHP suivant pour afficher tous les paramètres:
<?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'));
Tester un webhook en ligne
Avec le service gratuit webhook.site vous pouvez immédiatement tester un webhook en ligne.
Copier la configuration d'un webhook vers un autre profil d'utilisateur.
L'API Administrateur vous permet de copier la configuration d'un webhook d'un profil d'utilisateur à un autre.