Webhooks are used to send out HTTP requests. Both Awesome Miner and Discord can send out these kind of HTTP requests. There are however no feature in Awesome Miner to receive incoming HTTP requests - so if Discord sends out something - Awesome Miner will not be able to receive it.
The Discord HTTP (Post) webhooks are a service to service to recevice the webhook and post the update to a discord channel. Please let me know how to send from AM and receive in Discord. Ive setup the channel and added the AM webhook url to discord, but am not able to get the notifications.
There is a rule action in Awesome Miner called "Send webhook request". You can enter the target URL (where Discord is listening to incoming requests), select POST as HTTP method, and then fill in the POST body. The POST body is likely a JSON structure with the properties that Discord expects according to their documentation. From an Awesome Miner point of view - it's just some text to be sent.
I tried, but AM send no webhook to Discord. I test it with a normal rule and a rule with activation via action toolbar.
I get this in the Log file:
15.06.2020 14:24:35.622 [122] [S Sending Webhook POST to: https://discord.com/api/webhooks/722053497662472282/vN5L2VdtOUVQ2_qyNIdSjpd57gVa_krTXAzlRF9Xm8LLomBPungQwFDcL8hRuwvZfErz
15.06.2020 14:24:35.836 [122] [E]System.Net.WebException: Der Remoteserver hat einen Fehler zurückgegeben: (400) Ungültige Anforderung.
15.06.2020 14:24:35.836 [122] [E] bei System.Net.WebClient.UploadDataInternal(Uri address, String method, Byte[] data, WebRequest& request)
bei System.Net.WebClient.UploadString(Uri address, String method, String data)
bei #=zlQ$o$K9xavCaceTJJ2KjUcQDwvKxfEvrGUqnmttdR6vm.#=zK$vF2Z0=(String #=zWbiXOg0=, #=zM7Yz8troyqNmb0JpIPVRuFrlS_Ydij54JLHkw$2h3yBK #=zt9myUJE=, String #=zzcig3Vs=)
And sometimes i only get this:
15.06.2020 15:38:45.322 [023] [S Sending Webhook POST to: https://discord.com/api/webhooks/722053497662472282/vN5L2VdtOUVQ2_qyNIdSjpd57gVa_krTXAzlRF9Xm8LLomBPungQwFDcL8hRuwvZfErz
But i see no message in Discord.
Discord expects a HTTP header called Content-Type to be set to application/json. The webhook feature in Awesome Miner doesn't allow you to add headers, but I've implemented support for that now.
In the next release you will find a new field "HTTP headers" where you should add the following line:
Content-Type: application/json
Ok thanks