Best answer

webhook POST - JSON formatting problem

  • 30 March 2020
  • 1 reply
  • 2085 views

Hi There,

creating the POST below of an order in postman works.

{
    "@priority": 1,
    "Order": {
        "Content": {
            "CustomerReference": "test order nummer",
            "Items": {
                "Item": [
                    {
                        "Sku": "1",
                        "Quantity": 1
                    },
                ]
         
    }
}

 

 

Now i try to replicate this in a Zapier WEBHOOK, but get 400 errors all the time, What am i don’t wrong?

What is the syntax i need to use?

 

PAYLOAD TYPE: JSON

@priority    1

Order_Content_CustomerReference    test order nummer

 

 

OR

“@priority”.   1

“Order”

“Content”

“CustomerReference" test order number

????

 

I really don’t know anymore.

 

Does anyone have some insights about the formatting?

 

Kind regards Martijn

 

 

icon

Best answer by TimS 5 April 2020, 08:09

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.

1 reply

Userlevel 7
Badge +2

Hi Martijnc,

 

Tim here from Zapier support. I took a look at your JSON for the request, and while some parts are possible to set up in a POST Webhooks by Zapier action, some parts, like the array of objects in “Item” are not. 

 

For the nested parts that are possible, you could do this:

“Order__Content__CustomerReference": "test order number"

The double underscores denote the nesting. 

 

To get the whole thing working, I’d recommend using a Custom Request Webhooks by Zapier Action instead. It’s a little less forgiving to set up and use, but you can define the exact JSON structure you want. It would probably end up looking something like this:

https://zappy.zapier.com/66c3f89d6da47a37d0b7cdd5aec91778.png

 

Best,

Tim