Skip to main content
Question

Discord Custom Request - Error code 400

  • September 1, 2024
  • 2 replies
  • 89 views

To preface this, I’ll inform you that this is one of my first times properly using Zapier. I’m still playing around to learn new things so some simple advice might seem a bit difficult to me

 

I am currently trying to link my sites BetterUptime page to Discord via a Custom POST request. I am doing this as the in-built method seems to be restricted when it comes to Embeds on Discord.

 

The Tree of my Zap

 

Now, I have the method set to “POST” and the URL is set to the Discord webhook URL. This has been copied straight from the Discord client and inserted into this field with no changes.

 

Next I have my data field where I have inputted what I want the embed to send to the channel.
 

The fields in question
{
  "content": "🚨 **INCIDENT ALERT** 🚨",
  "embed": {
    "title": "INCIDENT ALERT: [TITLE OF FAILING MONITOR]",
    "description": "Details of the incident are provided below.",
    "url": "https://status.2smoke.co.uk",
    "color": 16711680,
    "timestamp": "2024-09-01T11:54:55.422Z",
    "footer": {
      "text": "[Name of the team]",
      "icon_url": "https://cdn.discordapp.com/avatars/974413091456565248/93fe44912f5bd1f0404e4c38b5678ba7.webp?size=80"
    },
    "author": {
      "name": "[Name of the team]",
      "url": "https://status.2smoke.co.uk",
      "icon_url": "https://cdn.discordapp.com/avatars/974413091456565248/93fe44912f5bd1f0404e4c38b5678ba7.webp?size=80"
    },
    "fields": [
      {
        "name": "Cause:",
        "value": "[Cause of the Incident]",
        "inline": true
      },
      {
        "name": "Incident ID:",
        "value": "[Incident ID]",
        "inline": true
      },
      {
        "name": "Status:",
        "value": "[Status]",
        "inline": true
      }
    ],
    "thumbnail": {
      "url": "https://cdn.discordapp.com/embed/avatars/0.png"
    }
  }
}

 

Above is the full contents of the “Data” field. I have not yet added any of the BetterUptime integrations as I am still just testing, these will be added in the fields marked []


Now after this, my remaining fields are setup like so:

 

The remaining fields in my Zap

 

Unfortunately, when it comes to testing this webhook, I am provided with this error:
 

Now my expertise are quite small in regards to HTTP requests etc. But I’d assume that this is telling me that something could be wrong with the Webhook URL, or that Discord and Zap aren’t able to communicate.

 

Could anyone please give me a bit of advice on how to sort this please?

 

Thanks!

Did this topic help you find an answer to your question?

2 replies

Troy Tessalone
Forum|alt.badge.img+14
  • Zapier Expert
  • 30739 replies
  • September 3, 2024

Hi @2SMOKE 

What is the link to the API endpoint documentation you used to configure the Zap step?

Screenshot does not show info about how the URL is configured.

Header is not configured correctly.

 


SamB
Community Manager
Forum|alt.badge.img+11
  • Community Manager
  • 7304 replies
  • September 12, 2024

Hi @2SMOKE 👋

Did you manage to get it working by updating the headers for the request as Troy mentioned? 

If not, and you’re still running into some issues can you share a screenshot showing the endpoint that’s been entered? That’ll help us to determine whether the rest of the setup on the webhook matches the requirements on Discord’s end. Make sure to blur or remove all personal information (names, emails, addresses etc.) from screenshots before sharing.

Looking forward to hearing from you!