PHP code example of teamup / webhook-php

1. Go to this page and download the library: Download teamup/webhook-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

teamup / webhook-php example snippets


$webhook = new Webhook(new Parser('my-secret'));

$webhook->registerHandler(Trigger::Any, new MyLogHandler());
$webhook->registerHandler(Trigger::EventCreated, new OnEventCreatedHandler());

$webhook->handle($request);

$content = file_get_contents('php://input');

$parser = new Parser('my-secret');

// should throw InvalidSignatureException if the secret is incorrect or the data is corrupted
$parser->verifyIntegrity(
    $content,
    getRequestHeader(Header::TeamupSignature->value),
);

// If the integrity is verified, you can parse it or just process the raw payload
$payload = $parser->parse($content);
bash
$ composer