Skip to content

This application designed to send messages to a Slack channel using Slack's Incoming Webhooks.

Notifications You must be signed in to change notification settings

satyyam11/slack-integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slack Integration Spring Boot Application

Overview

This project is a Spring Boot application designed to send messages to a Slack channel using Slack's Incoming Webhooks. The application provides a REST endpoint to accept a message and send it to a predefined Slack channel.

Table of Contents

Objective

The main objective of this project is to create a Spring Boot application that sends messages to a Slack channel via Slack's Incoming Webhooks.

Features

  • REST endpoint /sendSlackMessage to accept POST requests with JSON payloads.
  • Integration with Slack using Incoming Webhooks.
  • Configuration of Slack webhook URL via application properties.
  • Unit and integration tests for the service and endpoint.

Running the Application

  1. Build and Run the Application:

    • Use Maven to clean, install, and run the application.
    • Use IDE of your choice preferaably IntelliJ or Eclipse.
  2. Test the Application:

    • You can use these links to test it on my Slack channel:
      • Slack Channel Link: Slack Channel
      • Webhook Link: (Already mentioned in the code)
  3. Use Your Own Webhook:

    • Alternatively, you can use your own webhook and run it in your own Slack channel.
    • To do this, set up a Slack Incoming Webhook and get the webhook URL.
    • Update the application.properties or application.yml file in the src/main/resources directory with your Slack webhook URL.
  4. Use a Tool like Postman:

  • Use a tool like Postman to send a POST request to http://localhost:8080/sendSlackMessage with a JSON payload containing the message you want to send.
  1. All the main code files are under src/main/java/com/example/slackinteg

Testing

The application includes unit tests and integration tests to ensure functionality.

  • Unit Tests:

    • Located in the src/test/java/com/example/slackintegration/SlackServiceTest.java.
  • Integration Tests:

    • Located in the src/test/java/com/example/slackintegration/SlackControllerTest.java.

To run the tests, use Maven to execute the test phase.

About

This application designed to send messages to a Slack channel using Slack's Incoming Webhooks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages