In what format to specify the data for Discord

I tried specifying the data for Embeds and Attachments in different formats, but an error occurs when sending.

Can you tell me which format to use for Embeds and Attachments to send them without an error?

Hi @Artem, check out this example I posted recently: Discord webhook embeds - #2 by MutedJam

1 Like

Do you have an example with Attachments?

Can you also show me an example of how you send a message to Discord via HTTP Request?

I tried different variants, but my response is “ERROR: The data in “Body Parameters” is no valid JSON. Set Body Content Type to “RAW/Custom” for XML or other types of payloads”.

Thank you.

Hi Artem, tbh I don’t the Discord note is suitable for that. It has an attachment field but from looking at Discord Developer Portal it seems you would need to upload the file first which the node doesn’t support.

From reading this documentation I believe (but I am not a regular Discord user, so might be wrong here) it seems you first need to register an OAuth2 application with Discord and and then create a set of OAuth2 credentials within n8n. Only then would you be able to authenticate with Discord. However, chances are to actually upload a file you might need to write custom code in the Function node if the respective Discord endpoint requires binary and text data at the same time.

As for using the HTTP Request, this works for me:

Result:

image

1 Like

Thanks a lot, I will try via HTTP Request

1 Like

You are most welcome and sorry for not being much help with attachments here.

1 Like