<?php $data = file_get_contents('php://input'); $req_dump = print_r(json_decode($data), true); file_put_contents( 'request.log', $req_dump ); ?>
As you can see in the image on the right, Riddle’s quiz webhook sends you all data as a nicely formatted JSON string via POST.
All you need to do is grab that POST JSON and process it as you like.
The sky is the limit of where you can go from here. You can write your own code to:
- push the Riddle data to a CRM of your choice
- write it all into your own database
- build your own personal Riddle dashboard
- and dozens of other use cases
Need help or custom code? Reach out to us via email@example.com and we’re happy to help. Basic questions are easy and free – but we’re also available for hire to write your own webhook if you don’t have the code background).
The code above is just a starting point. Use this improved PHP code to process the data sent through to your hook if you know your way around PHP (as you will see below, this code is just a starting point. It does not really do anything with the data yet)
This is the output in the request.log file generated by the code on the left