Question

NEW | Webhook Patch: Validation Failure 400 Error


Badge

I am trying to use Webhooks to pass data multi-reference field data from Google Sheets to Webflow.

I’ve follow tutorials and checked other people with the issue and it looks like I have everything configured properly, but I’m still getting an error.  

  • Data Pass-Through = False
  • Multi-reference fields IDs in quotes
  • Collection and Item IDs set properly

Can anyone help?

 

 

This is the error

 


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

19 replies

Userlevel 7
Badge +9

Hi @Brian16 

Status code 400 is indicating that your JSON formatted code isn’t valid, try checking your JSON (in the data field) with https://jsonlint.com to verify whether you are sending proper JSON value. You can try sending static values by removing the google sheet mappings from the API step and hardcode the data and see if that works.

Badge

Thanks @robschmidt.  What’s strange is I got this working but then it broke.

When I test on Webflow’s Patch Collection API tool it works for patching a single item to the skills-tags field, but with multiple item IDs it breaks.  Again very strange/frustrating because I had it working yesterday. 

 

This is the format:

NOT WORKING:
curl --request PATCH \

     --url 'https://api.webflow.com/collections/[COLLECTION IT]/items/[ITEM ID]?live=true' \

     --header 'accept: application/json' \

     --header 'authorization: Bearer [API KEY]' \

     --header 'content-type: application/json' \

     --data '

{

  "fields": {

    "slug": "mem_cljr4ok012woi0shqfnc0fh8d",

    "name": "[EMAIL]",

    "_archived": false,

    "_draft": false,

    "skill-tags": "\"64a6bb15a257876f2a611c46\",\"64a6bb177172a75c4b1fc6b9\""

  }

}

'

WORKING:

curl --request PATCH \

     --url 'https://api.webflow.com/collections/[COLLECTION IT]/items/[ITEM ID]?live=true' \

     --header 'accept: application/json' \

     --header 'authorization: Bearer [API KEY]' \

     --header 'content-type: application/json' \

     --data '

{

  "fields": {

    "slug": "mem_cljr4ok012woi0shqfnc0fh8d",

    "name": "[EMAIL]",

    "_archived": false,

    "_draft": false,

    "skill-tags": "64a6bb15a257876f2a611c46"

  }

}

'

Userlevel 7
Badge +14

Hi @Brian16 

 

There are double quotes at the start and end of the values.

 

Badge

@Troy Tessalone thanks.  Sadly that doesnt seem to be the problem.

I added quotes around each value when passing in multiple.  That is what every tutorial says to do for multi-reference fields and then the API adds those additional quotes automatically.

These are the values I pass in for the skill-tags field:
"64a6bb15a257876f2a611c46","64a6bb177172a75c4b1fc6b9"

Then the curl output is:
"skill-tags": "\"64a6bb15a257876f2a611c46\",\"64a6bb177172a75c4b1fc6b9\""

Each skill tag ID works if I add it individually on the with no quotes on the Webflow Patch Collection tool so it does definitely feel like its a formatting issue though.

 

When I remove all quotes I get this curl output:
"skill-tags": "64a6bb15a257876f2a611c46,64a6bb177172a75c4b1fc6b9"

And this error:
"msg": "Validation Failure",

  "code": 400,

  "name": "ValidationError",

  "path": "/collections/64624924d0bad2ab82df04ac/items/64a6ba177172a75c4b1e9a7c",

  "err": "ValidationError: Validation Failure",

  "problems": [

    "Field '---': Invalid argument provided: Not an id: null"

  ],

Userlevel 7
Badge +14

@Brian16 

Have you tried this?

skill-tags looks to be a custom field.

What type of field is “skill-tags”?

If it’s an array, then try formatting the data like this:

"skill-tags": ["64a6bb15a257876f2a611c46","64a6bb177172a75c4b1fc6b9"]

 

 

Badge

@Troy Tessalone it is an array (multi-reference field in Webflow). 

 

When I add brackets to the interface (the screenshot you have above) I get the same error.

 

 

Userlevel 7
Badge +14

@Brian16 

Have you tried testing it outside in the Zap as recommended?

Looks like the Webflow CMS API Explorer auto formats the data.

Badge

@Troy Tessalone  The Zap is formatted like this, with the brackets outside:



 

Userlevel 7
Badge +14

@Brian16 

These fields are required as part of the supplied data:

  • slug
  • name
  • _archived
  • _draft

 

 

 

Badge

I am passing those fields @Troy Tessalone

 

And it is working for single items, so I dont think that’s the issue, but could be wrong.

Userlevel 7
Badge +14

@Brian16 

In the Zap, I don’t see those other fields, only skill-tags.

 

Badge

@Troy Tessalone - all the tutorials say to only include what I have included. 

 

I’m not sure how to add those fields to the payload, but I’ll try to figure that out.

 

I dont think that’s the issue though because when I use the Webflow tool that does have those fields it gets the same error:

 

 

Userlevel 7
Badge +14

@Brian16 

Which tutorials are you referring to? (links)

Userlevel 7
Badge +14

@Brian16 

It looks like the Webflow tool treats every custom field as a string, which may not be the correct way to format the JSON data.

 

Badge

@Troy Tessalone here is one, but I’ve watched a few of them.

 

Badge

@Troy Tessalone and this Zap was working yesterday.  Here is an example of a successful run:

 

Badge

Doing some testing and when I hardcode in multiple skill IDs like this it works

 

 

But when I replace this with a field form the spreadsheet which these values were copied from it fails
 

 

Badge

I think I found the issue.  One of these skills itself was deleted from Webflow.  Fun 5 hours wasted :)

 

Thank you so much for the help @Troy Tessalone 

Userlevel 7
Badge +14

@Brian16 

I was able to get it working.

Try these Headers and capitalize the same.

Make sure you are testing with skill-tag values that are valid.