Discord API: undefined error: this header name is not correct undefined

I’m trying to create a webhook for discord and getting this error. I’m trying everything and cant figure it out. Any ideas?

undefined error: this header name is not correct undefined

Your “{channel.id}” should be like this “[channel.id]” then it will let you add that value into the url. It looks like right now your url is not getting the correct value from the Body JSON.

Hey @williamtisdale you’re right. Silly mistake on my end. I updated the body with the proper JSON to generate a new webhook. However, now I’m getting a new error (screenshot). Have you seen this before?

I also included a screenshot of the Authorization instructions for Discord.

I think you should look at this post to see what you should be doing. I personally have never successfully connected an oauth2 user-agent flow in the api connector but instead use the method described in this post where when a user logs in they are directed to a discord auth page where they login and then get redirected back to your app with a key in the url and that key can be used for all your api calls. Check the post. Hope this helps.

Actually the error say that method (POST) is not the correct method for this endpoint. Please share a link to doc

That post you shared is extremely helpful. Thank you. @Jici I think the error message is wrong on bubble’s side. The problem was resolved when I put in a value for Channel ID instead of leaving it blank. That allowed it to initialize. POST was still the right method. Maybe Bubble’s error messages was technically right?? But not helpful with finding a solution.

The error was not wrong. The endpoint that you tried eas probably not accepting post request without the ID. Without ID is a different endpoint vs with. The error also doesn’t come from Bubble but from API server.

1 Like

Ah that makes much more sense. Thanks :pray:

1 Like