Hey all,
Has anyone experienced trouble with API calls to PATCH with an error “‘fields’ is required”? I can successfully make GET and DELETE calls (using Postman) but haven’t succeed in any of the proactive calls like PATCH, PUT or POST. I am trying to troubleshoot in Postman to ultimately use a Zapier Webhook to PATCH a reference field in the CMS.
The error I receive is “‘fields’ is required”. The API token, Content-Type and accept-version are all fine. The field ID I am trying to patch is also fine (I double-checked it using a GET call to the API). Has anyone had this hurdle and overcome it?
I wanna cry. It worked! I swear I tried it in the past with and without a comma and it made no difference, but this time it worked. Thanks so much Sam!
Definitely Andy!!
Now just trying to figure out the right way to PATCH a field that is a CMS reference field.
The error message (when I try to use the actual “name” of the record I’m referencing) is:
“Expected value to be an ItemRef”
Incredible, Andy, thank you!! It works. Been stewing about this for over a week. So relieved! Taking a breath and will now try and reorganize the AirTable fields and zaps to work with this new Item ID organization. Thanks again
@tim28 awesome! It does also work with multiple items at once, but it can be a bit fussy about the format. I use a Rollup column in Airtable to enable this, but it depends on your needs.
@Andy_Vaughan exactly, you got me over a huge hurdle by explaining that the CMS reference patch must be to the Webflow item ID. Now I’m at the point where Postman is working for this API call, but when I try to run it in Webhooks by Zapier, it doesn’t work. The error message is:
The app returned “Invalid access token provided.”.
Does anything leap out at you?
Thanks @Andy_Vaughan it was a good try but the square brackets didn’t change it – still the ‘invalid access token provided’ message from Webhooks by Zapier.
@tim28 weird. I’ll have to have another look tomorrow when I’m on the PC I’m afraid (UK time here) as I’m on my phone right now, and I can’t pretend that I’m an expert on this topic unfortunately.
@tim28 I’ve just done some playing in Zapier, and the only way I can replicate the same error code that you are getting is by making a mistake in the “Authorization: Bearer” section.
One thing I noticed is that it’s easy to end up with a superfluous space between “Bearer” and your API key. I found that adding a space between the two didn’t actually move the text at all - Bearer Key looks identical to BearerKey. It will not work if there is a space between the two. Give that a go and see if that works for you.
@Andy_Vaughan because you were kind enough to test what I had done, you identified the problem and solved my week-long headache. The problem was indeed between Bearer and the key…I found that it does need a single space, but not a linebreak!
In other words,
Bearer XXXXXXXXXX
NOT
Bearer
XXXXXXXXXXX
These do look the same on the Webhooks by Zapier console, since Zapier adds a natural linebreak when you enter a space.
So, to sum up this thread thanks to @Andy_Vaughan and @sam-g, I learned that:
JSON data entries cannot have an extra comma, if there is no additional data following.
CORRECT EXAMPLE:
{
“fields”: {
“appointment-type”: “studio”
}
}
Patching Webflow CMS reference fields (it doesn’t matter if they are single reference or multi-reference) must be done using the Webflow item ID, not the Webflow name or slug.
Authorization in Webhooks by Zapier must strictly follow:
Bearer XXXXXXXXXX
Hi Guys. I’m having the same issue with the API validation. I have tried with and without spaces @tim28 can you confirm whether you were using around your api key and how you made sure t didn’t have a linebreak?