Best answer

Webhook "400: Bad Request" connecting to Discord

  • 4 November 2020
  • 17 replies
  • 4823 views

Userlevel 1
Badge

Hi,

I am trying to connect a Webhook to Discord and the result is always a "400: Bad Request".

My st up is:

 

Action Event: Custom Event
Methos: POST

Th Webhook URL given by Discord

Data:


https://leovoel.github.io/embed-visualizer/ Proves formatting is correct

 



Under headers content-type | applications/json

And still I get a  "400: Bad Request".

 

 

 

¿Any Suggestions?

icon

Best answer by Juan 18 November 2020, 18:07

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

17 replies

Userlevel 7
Badge +9

Hello! Please can you share how you’ve configured this in Zapier?

Userlevel 1
Badge

@andywingrave,  don´t understanbd what do you mean, as all the info about the configuration in zappier is in the message and the code of the webhook in the photo.
Is there other config that I am not showing?

Userlevel 7
Badge +9

@Juan sorry, I mean the form data you configure before you get that message.

Userlevel 1
Badge

¥es @andywingrave its there. I´ll copy it again here:

My st up is:

Action Event: Custom Event
Methos: POST

The Webhook URL given by Discord
Under headers content-type | applications/json


https://uploads-us-west-2.insided.com/zapier-ca/attachment/f7685e10-6fc4-44e2-b26c-54b97b2dedcd.png

 

 

Userlevel 7
Badge +9

Hey! That’s the screenshot of your JSON - I meant can you please share a screenshot of what you have set up in your Zapier webhook?

Userlevel 1
Badge

@andywingrave 
My st up is:

Action Event: Custom Event
Method: POST

The Webhook URL given by Discord (not the one on the screenshot)
Under headers content-type | applications/json

 

 

Userlevel 7
Badge +9

Hey - The reason why this is not working is that you need to add authentication to a POST request. Have you tried this?

Userlevel 1
Badge

Hey - The reason why this is not working is that you need to add authentication to a POST request. Have you tried this?


No I have not. How can I do that @andywingrave 

 

Thank you.

Userlevel 7
Badge +9

Hey @Juan This is really something that a developer should be doing, or at least someone who has spent some time with making HTTP requests, so it pains me to say it, but you’d need learn these fundamentals before making these kind of steps. 

There’s some documentation here: https://discord.com/developers/docs/reference

But honestly? I would start here: https://learning.postman.com/

 

Userlevel 1
Badge

Thank you Andy, but if I have already authorized Zapier as the Bot in Discord, shouldnt Zapier handle de HTTP request authentication? It is not a required field. And if I dont use Embed and only content, it will pass without the Basic Auth. 

Userlevel 7
Badge +9

But are you using a Webhook or a Discord task here? It looks to me like you’re using a webhook? (Sorry if I’m wrong) 

 

For your Discord log-in to be used in tasks, you’d need to select a Discord task like one of the ones below 

But a webhook is a completely seperate thing, and your credentials don’t carry over.

Hope that makes sense. 

Userlevel 1
Badge

Hi @andywingrave Its a Webhook.

Looking into Discord developer docs about Webhooks it states clearly that they dont require authentication to be used.

 

“Webhooks are a low-effort way to post messages to channels in Discord. They do not require a bot user or authentication to use.”
https://discord.com/developers/docs/resources/webhook

 

Userlevel 1
Badge

Hi Andy,

 

Managed to make the webhook work without Authentication. The problem was in the code. I got an expert to help me with the Discord code and it works.

 

BUT

 

As soon as I insert Zapier Values like {{103505283__COL$D}} that comes from my Worksheet it will break the code again. If I enter the text that is in the worksheet cell, it works.
 

Userlevel 1
Badge

I Finallly made it!
If someone needs help with this just write and will help gladly

Userlevel 7
Badge +9

That’s awesome! Well done! Can you explain to the rest of us what was wrong and how you fixed it? 

Userlevel 1

I Finallly made it!
If someone needs help with this just write and will help gladly

Hi Juan, I’d like to know how did you fix this error.

Userlevel 7
Badge +11

Hey @Juan!

That’s fantastic that you got it working. If you’d be able to explain how you accomplished that, we sure would appreciate it :)