๋ฐ˜์‘ํ˜•

์‹œ๋†€๋กœ์ง€ Chat ๋ฉ”์‹ ์ €

์‹œ๋†€๋กœ์ง€์—๋Š” Chat์ด๋ผ๋Š” ๋ฉ”์‹ ์ €๋ฅผ ์ œ๊ณตํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋Š” ํŒจํ‚ค์ง€ ์„ผํ„ฐ์—์„œ ์„ค์น˜๊ฐ€ ๊ฐ€๋Šฅํ•œ๋ฐ์š”. ์ฃผ์š” ํŠน์ง•์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

  • ๋ฌด๋ฃŒ๋กœ ์‚ฌ์šฉ ๊ฐ€๋Šฅ
  • ๋ฉ”์‹œ์ง€ ๊ณ ์ •(๊ณต์ง€ ์‚ฌํ•ญ), ๋ถ๋งˆํฌ, ํ•ด์‹œํƒœ๊ทธ, ์‚ฌ์šฉ์ž ๋ฉ˜์…˜, ๊ฒ€์ƒ‰ ๊ธฐ๋Šฅ
  • ์„ค๋ฌธ์กฐ์‚ฌ, ์ „๋‹ฌ, ์•Œ๋ฆผ, ๋ฉ”์‹œ์ง€ ์˜ˆ์•ฝ, ํŒŒ์ผ ์ „์†ก ๊ธฐ๋Šฅ
  • ๊ณต๊ฐœ, ๋น„๊ณต๊ฐœ ๋Œ€ํ™”๋ฐฉ
  • ํŒŒ์ผ ์ „์†ก
  • ์œˆ๋„์šฐ, ๋ชจ๋ฐ”์ผ ์•ฑ ์ง€์›
  • ์Šค๋งˆํŠธ ํฐ์—์„œ ํŒŒ์ผ ๊ณต์œ  ๊ฐ€๋Šฅ
  • ์ง€๋‚œ ๋Œ€ํ™” ๊ธฐ๋ก ์ €์žฅ

์ฆ‰, ์นด์นด์˜คํ†ก๊ณผ ๊ฐ™์€ ๋ฉ”์‹ ์ €๋ผ๊ณ  ๋ณด๋ฉด ๋˜๊ฒ ์Šต๋‹ˆ๋‹ค. ๋ฌผ๋ก , ๋ชจ๋‘๊ฐ€ Chat์„ ์‚ฌ์šฉํ•˜์ง€๋Š” ์•Š๊ฒ ์ฃ . ๊ทธ๋ž˜์„œ ์ €์˜ ๊ฒฝ์šฐ์—๋Š” ์‚ฌ๋‚ด ๋ฉ”์‹ ์ €(์—…๋ฌด์šฉ)๋กœ ํ™œ์šฉํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

์‹œ๋†€๋กœ์ง€ ์ฑ— PC ํ™”๋ฉด
์‹œ๋†€๋กœ์ง€ ์ฑ— PC ํ™”๋ฉด

์‹œ๋†€๋กœ์ง€ Chat Webhook ๊ธฐ๋Šฅ

์‹œ๋†€๋กœ์ง€ ์ฑ—์€ ์ˆ˜์‹ , ๋ฐœ์‹  Webhook์ด๋ผ๋Š” ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

์ˆ˜์‹  Webhook

์ˆ˜์‹  Webhook์€ ์™ธ๋ถ€์—์„œ Chat์œผ๋กœ ๋ฉ”์‹œ์ง€๋ฅผ ๋ณด๋‚ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ฆ‰, ์™ธ๋ถ€ ์ธํ„ฐ๋„ท์—์„œ ์‹œ๋†€๋กœ์ง€ Chat์œผ๋กœ ๋ฉ”์‹œ์ง€๋ฅผ ๋ณด๋‚ผ ์ˆ˜ ์žˆ๋‹ค๋Š” ์˜๋ฏธ์ฃ . ๋ฉ”์‹œ์ง€์—๋Š” ํ…์ŠคํŠธ์™€ ๋งํฌ ๊ทธ๋ฆฌ๊ณ  ํŒŒ์ผ ์—…๋กœ๋“œ๋„ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. ํŒŒ์ผ ์—…๋กœ๋“œ์˜ ๊ฒฝ์šฐ ์ตœ๋Œ€ ํฌ๊ธฐ๋Š” 32MB์ž…๋‹ˆ๋‹ค.

์ˆ˜์‹  Webhook ์„ค์ • ํ™”๋ฉด
์ˆ˜์‹  Webhook ์„ค์ • ํ™”๋ฉด

๋ฐœ์‹  Webhook

๋ฐœ์‹  Webhook์€ Chat ๋ฉ”์‹œ์ง€๋ฅผ ํŠธ๋ฆฌ๊ฑฐ ๋‹จ์–ด๋กœ ์ˆ˜์‹  ๋Œ€๊ธฐํ•ฉ๋‹ˆ๋‹ค. ์ฆ‰, ์ฑ—์— ํŠน์ • ๋‹จ์–ด๋ฅผ ์ž…๋ ฅํ•˜๋ฉด ํŠธ๋ฆฌ๊ฑฐ ์‹ ํ˜ธ๋กœ ์ธ์‹ํ•˜์—ฌ ๊ด€๋ จ ๋ฐ์ดํ„ฐ๋ฅผ ์™ธ๋ถ€ URL๋กœ ๋ณด๋‚ด๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.

๋ฐœ์‹  Webhook ์„ค์ • ํ™”๋ฉด
๋ฐœ์‹  Webhook ์„ค์ • ํ™”๋ฉด

์ข€ ๋” ์ž์„ธํ•œ ์‚ฌ์šฉ ๋ช…์„ธ๋Š” ์•„๋ž˜ ๋งํฌ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

https://kb.synology.com/ko-kr/DSM/help/Chat/chat_integration?version=6

 

Synology Chat์—์„œ ํ†ตํ•ฉ ์‚ฌ์šฉ | Synology Chat - Synology ์ง€์‹ ์„ผํ„ฐ

 

kb.synology.com

Webhook ์„ค์ • ๋ฐฉ๋ฒ•

์ฑ— ์‹คํ–‰ ํ™”๋ฉด์—์„œ ์šฐ์ธก ์ƒ๋‹จ์˜ ํ”„๋กœํ•„ ์‚ฌ์ง„์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

ํ”„๋กœํ•„ ํด๋ฆญ
ํ”„๋กœํ•„ ํด๋ฆญ

๊ทธ๋ฆฌ๊ณ  ํ†ตํ•ฉ ๋ฉ”๋‰ด๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

ํ†ตํ•ฉ ๋ฉ”๋‰ด ํด๋ฆญ
ํ†ตํ•ฉ ๋ฉ”๋‰ด ํด๋ฆญ

์•„๋ž˜์˜ ๋ฉ”๋‰ด์—์„œ ๋“ค์–ด์˜ค๋Š” Webhooks๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. ๋ณธ๋ฌธ์—์„œ๋Š” ๋‚˜๊ฐ€๋Š” Webhooks์œผ๋กœ ํ…Œ์ŠคํŠธํ•  ์กฐ๊ฑด์ด ์•ˆ๋˜๊ธฐ ๋•Œ๋ฌธ์— ๋“ค์–ด์˜ค๋Š” Webhooks๋งŒ ๋‹ค๋ฃน๋‹ˆ๋‹ค.

๋“ค์–ด์˜ค๋Š” Webhooks ๋ฉ”๋‰ด ํด๋ฆญ
๋“ค์–ด์˜ค๋Š” Webhooks ๋ฉ”๋‰ด ํด๋ฆญ

๋“ค์–ด์˜ค๋Š” Webhooks ํ™”๋ฉด์—์„œ ์ƒ์„ฑ ๋ฒ„ํŠผ์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

์ƒ์„ฑ ๋ฒ„ํŠผ ํด๋ฆญ
์ƒ์„ฑ ๋ฒ„ํŠผ ํด๋ฆญ

ํ”„๋กœํ•„ ์‚ฌ์ง„, ์ด๋ฆ„, ์ฑ„๋„์„ ์„ ํƒํ•˜๊ณ  Webhook URL์„ ๋ณต์‚ฌํ•ด ๋‘ก๋‹ˆ๋‹ค.

์ˆ˜์‹  Webhook ์„ค์ • ์˜ˆ์‹œ ํ™”๋ฉด
์ˆ˜์‹  Webhook ์„ค์ • ์˜ˆ์‹œ ํ™”๋ฉด

C#์—์„œ ์ˆ˜์‹  Webhook์œผ๋กœ ๋ฉ”์‹œ์ง€ ๋ณด๋‚ด๊ธฐ

ExamChatWebhook ์ด๋ฆ„์œผ๋กœ Windows Forms ์•ฑ ํ”„๋กœ์ ํŠธ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

Windows Forms ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ
Windows Forms ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ

UI์— ๋ฒ„ํŠผ์„ ํ•˜๋‚˜ ๋ฐฐ์น˜ํ•˜๊ณ  ์ฝ”๋“œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net;
using System.IO;

namespace ExamChatWebhook
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void buttonSendMessage_Click(object sender, EventArgs e)
        {
            //์ˆ˜์‹  Webhook url
            string webhookUrl = "";
            string payload = "&payload={\"text\": \"LuckyGg์˜ ๋ฉ”์‹œ์ง€, https://luckygg.tistory.com\"}";

            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(webhookUrl + payload);
            request.Method = "GET";
            using (var response = request.GetResponse())
            {
                using (Stream dataStream = response.GetResponseStream())
                {
                    using (var reader = new StreamReader(dataStream))
                    {
                        string requestResult = reader.ReadToEnd();
                    }
                }
            }
        }
    }
}

์ฝ”๋“œ๊ฐ€ ๋„ˆ๋ฌด ๊ฐ„๋‹จํ•˜์ฃ ? ์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•˜๋ฉด ์ฑ—์œผ๋กœ ๋ฉ”์‹œ์ง€๊ฐ€ ๋ฐ”๋กœ ์ „์†ก๋ฉ๋‹ˆ๋‹ค.

์ฑ—์œผ๋กœ ์ˆ˜์‹ ๋œ ๋ฉ”์‹œ์ง€
์ฑ—์œผ๋กœ ์ˆ˜์‹ ๋œ ๋ฉ”์‹œ์ง€

์ฝ”๋“œ์˜ ์ž์„ธํ•œ ์‚ฌ์šฉ ๋ฐฉ๋ฒ•์€ ์•„๋ž˜ ์ฒจ๋ถ€๋œ ์ฝ”๋“œ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

ExamChatWebhook.zip
0.01MB

๋ฐ˜์‘ํ˜•