PHP Classes

HoneyBadge Laravel Slack API Notification: Send message received by an API to a Slack channel

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 19 All time: 11,370 This week: 57Up
Version License PHP version Categories
honeybadge 1.0The PHP License5PHP 5, Web services, Project Management, C...
Description 

Author

This package can send messages received by an API to a Slack channel.

It implements a Web services API that can get the details of a message in a JSON object sent to the API via the HTTP POST method.

The package can send the message to a previously configured Slack channel using a Slack Webhook URL.

Innovation Award
PHP Programming Innovation award nominee
February 2024
Number 7
Slack is an application used by teams to collaborate on projects.

Slack also provides several means to receive notifications from external applications that may be important to the project teams.

This package provides an API to get a notification message via an HTTP request and forwards it to a Slack channel.

This way, this package allows the connection of external systems that may send notifications to the PHP Web services and API and the team that may be responsible for the systems and uses Slack to collaborate on the solution of problems that need a solution in those systems.

Manuel Lemos
Picture of Edward Paul
  Performance   Level  
Innovation award
Innovation award
Nominee: 12x

Winner: 1x

 

Documentation

<p align="center">a production-ready web endpoint that accepts a JSON payload as a POST request and sends an alert to a Slack channel if the payload matches desired criteria.</p> <p align="center"><a href="https://medium.com/@infinitypaul">Creator</a></p>

Tech Stack

  • Laravel
  • Mysql
  • PHP

Download Instruction

  1. Clone the project.
git clone https://github.com/infinitypaul/honeybadge.git projectname

  1. Install dependencies via composer.
composer install 

  1. Run php server.
php artisan serve

Troubleshooting

Setup

The slack channel requires a url configuration option. This URL should match a URL for an incoming webhook that you have configured for your Slack team. https://slack.com/apps/A0F7XDUAZ-incoming-webhooks

Add the webhook url to your .env
LOG_SLACK_WEBHOOK_URL=

Api Usage

> Using POST Request:

POST http://localhost/api/notify

payload: {
  "RecordType": "Bounce",
  "Type": "SpamNotification",
  "TypeCode": 512,
  "Name": "Spam notification",
  "Tag": "",
  "MessageStream": "outbound",
  "Description": "The message was delivered, but was either blocked by the user, or classified as spam, bulk mail, or had rejected content.",
  "Email": "zaphod@example.com",
  "From": "notifications@honeybadger.io",
  "BouncedAt": "2023-02-27T21:41:30Z"
}

  • http://localhost/ is your Base Url, You Can Replace it with yours

And Viola.

Enjoy!!


  Files folder image Files (68)  
File Role Description
Files folder imageapp (5 directories)
Files folder imagebootstrap (1 file)
Files folder imageconfig (15 files)
Files folder imagedatabase (3 directories)
Files folder imagepublic (3 files)
Files folder imageresources (2 directories)
Files folder imageroutes (4 files)
Files folder imagetests (2 files, 2 directories)
Accessible without login Plain text file .editorconfig Data Auxiliary data
Accessible without login Plain text file .env.example Data Auxiliary data
Plain text file artisan Class Class source
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file package.json Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file vite.config.js Data Auxiliary data

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:19
This week:0
All time:11,370
This week:57Up