Loading...
 

Webhooks

New in Tiki25, Webhooks can be used by an external system for notifying your system about a certain event or update.
They are for example, a universal means of sending data about contacts and their activities to a third party in real time as a change or activity occurs.

To allow web applications to communicate with each other in an automated way, Webhooks allow interaction between them through the use of customized callbacks.

In other words, a webhook triggers an action following an event. It allows you to receive an alert when a chosen event occurs in another system.

In Tiki25, we have integrated this system because some functionalities might need these kinds of callbacks in order to finalize with the actions they serve.

Initial commit: https://gitlab.com/tikiwiki/tiki/-/merge_requests/1649

Requirements

For this to work in Tiki, some configuration needs to be done but before that here is all you need:

  • the URL of the system from which you want to receive events. You need so to create a webhook in your caller system giving the correct tiki-webhooks.php url (it is output in Tiki admin)
  • The secret key which you should find and copy from the administration panel of the calling system.

Setup

For this to work, you have to do two steps:

Into the caller system

There, when you create a webhook, you will be asked to fill in the callback URL where the data will be retransmitted once an action has just been completed.
It is therefore there that you will look for the correct url tiki-webhooks.php.

This file is responsible for authenticating the user via a webhook. Webhooks are automatically verified. We try to check all those defined one by one and the first one to succeed wins. If none pass the check, we return an error.

You must therefore copy the secret code that will be provided to you, and that you will use in Tiki as described in the following point.

Into Tiki

  1. Go to Tiki admin -> Advanced -> security -> webhooks (Tab)
  2. Enable Webhook access
  3. create a webhook handler:
    • Verification type is 'base64 hmac',
    • Algo is sha256,
    • Header value is 'Webhook-Signature' and
    • Secret you can copy from your calling system admin panel
Click to expand
Click to expand

Webhook handling

Now that the prerequisites are done, you need to add the php code that manages the webhook in your Tiki installation.
This should be done here: _custom/lib/setup/custom.php.
In this file you should proceed like this:

  1. First define your custom event handler function
  2. Bind your custom function to an event. For this this case the event must be tiki.webhook.received
There is a readme explaining but in short, it can be something like:
Copy to clipboard
function my_webhook_handler($args) { // access the webhook object at $args['webhook'] // access input with normal PHP STDIN or access any other Tiki global variables as $user, $input, $_REQUEST, etc. } TikiLib::lib('events')->bind('tiki.webhook.received', 'my_webhook_handler');


Note that the chosen user at webhook creation time is automatically logged in, so your custom.php code will perform actions on behalf of that user.

doc.tiki.org

Get Started

Admin Guide User Guide

Keywords

Keywords serve as "hubs" for navigation within the Tiki documentation. They correspond to development keywords (bug reports and feature requests):

Accessibility (WAI and 508)
Accounting
Articles and Submissions
Backlinks
Banners
Batch
BigBlueButton audio/video/chat/screensharing
Blog
Bookmark
Browser Compatibility
Link Cache
Calendar
Category
Chat
Clean URLs
Comments
Communication Center
Compression (gzip)
Contacts (Address Book)
Contact us
Content Templates
Contribution
Cookie
Copyright
Credit
Custom Home and Group Home Page
Date and Time
Debugger Console
Directory of hyperlinks
Documentation link from Tiki to doc.tiki.org (Help System)
Docs
Draw
Dynamic Content
Dynamic Variable
External Authentication
FAQ
Featured links
File Gallery
Forum
Friendship Network (Community)
Gmap Google maps
Groups
Hotword
HTML Page
i18n (Multilingual, l10n)
Image Gallery
Import-Export
Install
Integrator
Interoperability
Inter-User Messages
InterTiki
Kaltura video management
Karma
Live Support
Login
Logs (system & action)
Look and Feel
Mail-in
Map with Mapserver
Menu
Meta Elements
Mobile Tiki and Voice Tiki
Module
MultiTiki
MyTiki
Newsletter
Notepad
Payment
Performance Speed / Load
Permissions
Platform independence (Linux-Apache, Windows/IIS, Mac, BSD)
Polls
Profiles
Profile Manager
Report
Toolbar
Quiz
Rating
Feeds
Score
Search engine optimization
Search
Search and Replace
Security
Semantic links
Shadowbox
Shadow Layers
Share
Shopping cart
Shoutbox
Slideshow
Smiley
Social Networks
Spam protection (Anti-bot CATPCHA)
Spellcheck
Spreadsheet
Stats
Surveys
Tags
Task
Tell a Friend, alert + Social Bookmarking
TikiTests
Theme CSS & Smarty
Tiki Manager
Trackers
Transitions
User Administration including registration and banning
User Files
User Menu
Watch
WebDAV
Webmail
Web Services
Wiki History, page rename, etc
Wiki Syntax
Wiki structure (book and table of content)
Workspace
WSOD
WYSIWYCA
WYSIWYG
XMLRPC

Tiki Newsletter

Delivered fresh to your email inbox!
Newsletter subscribe icon
Don't miss major announcements and other news!
Contribute to Tiki