hello-one/laravel-webhooks

Parse incoming webhook requests from hello-one.de

0.1.1 2020-05-17 02:28 UTC

This package is auto-updated.

Last update: 2024-04-18 09:11:36 UTC


README

Securely receive Webhooks from your hello one project.

Installation

  1. You can install this package via composer using the following command:

    composer require hello-one/laravel-webhooks

    The package will automatically register itself using package discovery.

  2. Add your app as a webhook on our dashboard. The default route is

    https://{{yourdomain.com}}/hello-one/webhook
    

    Please note: we only support TLS endpoints ("https only")

  3. Copy the secret signing key

  4. Add the secret signing key to your .env file

    HELLO_ONE_WEBHOOK_SIGNING_SECRET={{INSERT_TOKEN_HERE}
  5. Your app will now receive events from your hello one project. You can test the integration by sending a test-event from our dashboard

Usage

This package handles incoming webhook requests from hello one. It verifies the request signature of hello one webhook requests. When a request is valid the package emits and emits a Laravel Event

To react on any of the events you can create an event listener.

Listen to all webhook events with a wildcard:

Event::listen('hello-one.webhook.*', function (string $eventName, array $data) {
    Log::info('hello one event received: '.  $eventName, $data);
});

Listen to specific events:

Event::listen('hello-one.webhook.guest.created', function (string $eventName, array $data) {
    Log::info('A new Guest was just created', $data['guest']['id']);
    // use the data from $data['guest'] 
});

Event List

You can query the complete event list from our API

curl -X GET "https://api.hello-one.de/api/webhooks/events" -H  "accept: application/json"

Please note: in Laravel all events are prefixed with hello-one.webhook.

Laravel Event Name Description
hello-one.webhook.webhook_test This is a test event. You should ignore it.
hello-one.webhook.guest.created A Guest registered or was added by an admin
hello-one.webhook.guest.updated A Guest was updated
hello-one.webhook.guest.deleted A Guest was deleted
hello-one.webhook.event_booking.created The Guest made a reservation for an event
hello-one.webhook.event_booking.updated
hello-one.webhook.event_booking.deleted
hello-one.webhook.event.created An event was added to your project
hello-one.webhook.event.updated
hello-one.webhook.event.deleted
hello-one.webhook.session.created A session was added to an event
hello-one.webhook.session.updated
hello-one.webhook.session.deleted
hello-one.webhook.session_booking.created A Guest booked a session
hello-one.webhook.session_booking.updated
hello-one.webhook.session_booking.deleted
hello-one.webhook.form_submission.created A form was submitted
hello-one.webhook.form_submission.updated
hello-one.webhook.form_submission.deleted
hello-one.webhook.form.created A form was created
hello-one.webhook.form.updated
hello-one.webhook.form.deleted
hello-one.webhook.audience.created An audience was created
hello-one.webhook.audience.updated
hello-one.webhook.audience.delete

Configuration

Publish the config file and adjust as needed

 php artisan vendor:publish --tags 'hello-one-webhooks'

Documentation

Please notice our Webhook Documentation

Contributing

Feel free to open a ticket, submit a Pull Request or ask our Support Team