Skip to content

Latest commit

 

History

History

laravel

httpsms-laravel

Build GitHub contributors GitHub license

This recipe contains an example Laravel application to receive incoming webhook events from the httpsms.com API. You can use this code as inspiration for creating a consumer for webhook events from httpsms.com.

Documentation

httpSMS webhook documentation: https://docs.httpsms.com/webhooks/introduction

Dependencies

Architecture

The AuthenticateHttpSmsWebhook middleware to authenticates webhook requests from httpSMS using the Bearer JWT token. You have to set your webhook signing key in the config httpsms.webhook.signing_key. This key is used to validate the bearer token in the webhook request.

The HttpSmsWebhookController processes webhook requests and transforms the payload to a CloudEvent since the payload of webhook requests from httpSMS are valid CloudEvents.

Local Setup

Run the laravel application to listen to events using the command below

docker run -p 8000:80 --env HTTPSMS_WEBHOOK_SIGNING_KEY="/* your webhook signing key */"  ndolestudio/httpsms-laravel

In-order to receive events from httpsms.com to the application running on your local computer, you have to setup ngrok.io to listen on localhost:8000

ngrok http localhost:8000

Now configure your webhook endpoint https://httpsms.com/settings to point to the URL provided by ngrok. When you receive an SMS, you will see the logs in your terminal as shown in the image below.

image

Security Vulnerabilities

If you discover a security vulnerability within the dompdf-api service, please send an e-mail to Acho Arnold via [email protected]. All security vulnerabilities will be promptly addressed.

License

dompdf-api is an open-sourced software licensed under the MIT license.