Skip to content

Latest commit

 

History

History
58 lines (42 loc) · 1.92 KB

README.md

File metadata and controls

58 lines (42 loc) · 1.92 KB

Summary

Integration with discord can be used to send alerts to users and channels to notify when certain events are triggered.

API AutoFlow Version:

Configuration config.json was created using AutoFlow version 0.2.5

Need help?

Is you have questions about this example, feel free to post your question on the community "Ask Questions" website.

Step 1. Create flow

  • Create an HTTP Server
  • Create an endpoint
    • NOTE: under properties the method must be POST
  • From the right panel, press Action tab -> communication, Drag and drop HTTP-Request to the end of the flow
  • From the right panel, press Action tab -> data, Drag and drop Set to the end of the flow

Step 2. Setup Discord request body

Discord takes in HTTP request body as below

{
    "content": "Message content"
}

Use Data/Set action to create the object.

Step 3. Discord API Call

Communication/HTTP-request

Properties:

  • url: NOTE: Paste the discord webhook
  • Method: POST
  • Body: Contents of what is being posted to discord. NOTE: May need to specify the content type as application json. { “Content-Type”: “Application/JSON” }
  • Header: blank
  • Query: blank
  • Timeout: Default

Output:

  • Output-location: Drag and drop the response body from right data panel

Step 4. Test and Send Messages to your workspace

Using Postman API Tester:

Select Method Post and Paste your discord http server. NOTE: Yours may differ Image

In the HTTP Request Header, insert the message you want to send. For example

Hello World!

Configuring Discord api webhook

Creating Webhook

https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks

Discord Message Format

https://birdie0.github.io/discord-webhooks-guide/discord_webhook.html