Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zapier Webhooks Posting Json Array

I'm having trouble getting Zapier's webhooks to post a true JSON array.

I want the webhook post data to be like this:

{
    "attachments": [
    {
        "color": "danger",
        "fallback": "My fallback text is here", 
        "title": "My Title is here",
        "text":" foo"
    }
    ]
}

But all I can get is this (notice the missing "[", and "]"). How can I get a properly formatted JSON array from Zapier's webhooks?

{
"attachments": 
    {
    "color": "danger", 
    "text": "foo", 
    "fallback": "My fallback text is here", 
    "title": "My Title is here"
    }
}

Here is what my Zapier Webhook configuration looks like:

enter image description here

like image 461
Camden S. Avatar asked Apr 01 '17 20:04

Camden S.


People also ask

How do you use Zapier Webhooks?

Select the action app—the app you want to send data to. You'll see form fields to add data to that app. Click in the field where you want to add webhooks data and select it from the dropdown. Test your Zap and it's now ready to use.

Can Zapier make API calls?

If you need to create a Zap to work with an individual inbox, create an API token that has access to your individual inboxes, and utilize the Webhooks by Zapier Zap triggers and actions to issue API calls to Front.

Can Zapier receive Webhooks?

Zapier lets you connect Webhooks by Zapier with thousands of the most popular apps, so you can automate your work and have more time for what matters most—no code required.


1 Answers

The default Webhooks > "POST" action coerces the payload values (including those that look like arrays) to strings, so you can't send an array value this way.

Instead of the "POST" action, you should use the "Custom Request" action.

This action allows you to specify the raw JSON payload. You can insert fields from previous steps anywhere in the object literal as long as the JSON syntax is good.

like image 167
Juan Vazquez Avatar answered Oct 22 '22 17:10

Juan Vazquez