| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,14 @@ |
| 1 |
+<?php |
|
| 2 |
+require_once(__DIR__ . '/../init.php'); |
|
| 3 |
+ |
|
| 4 |
+// Please fetch the public key from: https://portal.telnyx.com/#/app/account/public-key |
|
| 5 |
+\Telnyx\Telnyx::setPublicKey('######');
|
|
| 6 |
+ |
|
| 7 |
+// Validate the webhook against the public key and retrieve the event object |
|
| 8 |
+$webhook_event = \Telnyx\Webhook::constructFromRequest(); |
|
| 9 |
+ |
|
| 10 |
+// Now you can work with the $webhook_event object |
|
| 11 |
+print_r($webhook_event); |
|
| 12 |
+ |
|
| 13 |
+// Send status code to signal that the webhook was successfully received |
|
| 14 |
+http_response_code(200); |
|
| 0 | 15 |
\ No newline at end of file |