Feb 22, 2024 05:53 AM
I'm using a simple JSON to POST data to create a new record in Airtable.
I'm using Field IDs to prevent name changes from affecting the integration. I've replaced the actual field ID's below for this example, however I'm using the correct Field IDs in in my production environment.
I'm using variables captured from the chat to send to Airtable.
{
"records": [
{
"fields": {
"fld1": "{First_Name}",
"fld2": "{Last_Name}",
"fld3": "{eMail}",
"fld4": "{Boomo_Intent}",
"fld5": "{MCI_Copilot_Feedback}"
}
}
]
}
I've verified both my endpoint URL and Authorization API Key.
I've troubleshot this for a couple of days now including using ChatGPT but still get the following error:
{
"error": {
"type": "INVALID_REQUEST_MISSING_FIELDS",
"message": "Could not find field \"fields\" in the request body"
},
"VF_STATUS_CODE": 422,
"VF_HEADERS": {
"access-control-allow-headers": "authorization,content-length,content-type,user-agent,x-airtable-application-id,x-airtable-user-agent,x-api-version,x-requested-with",
"access-control-allow-methods": "DELETE,GET,OPTIONS,PATCH,POST,PUT",
"access-control-allow-origin": "*",
"airtable-datacenter-regions": "us-east-1",
"connection": "close",
"content-length": "115",
"content-type": "application/json; charset=utf-8",
"date": "Thu, 22 Feb 2024 13:49:19 GMT",
"etag": "W/\"etag value\"",
"server": "Tengine",
"set-cookie": "Cookie value",
"strict-transport-security": "max-age=31536000; includeSubDomains; preload",
"vary": "Accept-Encoding",
"x-content-type-options": "nosniff",
"x-frame-options": "DENY"
}
}
I'm stuck... does anyone have any thoughts?
Solved! Go to Solution.
Oct 03, 2024 11:15 AM
I found the solution, you have to add
Content-Type
application/json
in the HEADER and not as a PARAMETER
BTW I build www.wellhr.org give it a try
Feb 22, 2024 07:17 AM
Hm, that sorta looks fine? Here's one that works for me:
{
"records": [
{
"fields": {
"fld88Ky0ssK0MIz9B": "1"
}
}
]
}
If I were you I'd just test it one field at a time with Postman to see where the error was I think
Mar 20, 2024 12:27 PM
Hey @StilMan25 did you found the error?
I am stuck with the same issue, and it works on Postman...
When I do the same request but with GET, I get a 200.
Here is my JSON, copy/pasted from airtable... (and yes I tried with "records" too)
{
"fields": {
"ThreadID": "123",
"Date": "2024-03-20T16:23:00.000Z",
"Transcript": "abc",
"Subjects": "xyz"
}
}
Mar 20, 2024 12:32 PM
Nothing solved yet @Stride-up
Mar 21, 2024 02:43 AM
@StilMan25 maybe a workaround could be to call a make automation that calls airtable... Not at all optimal but it may work...
I don't have time to try it but wanted to let you know the idea
Jul 12, 2024 12:42 PM
I had a similar issue. The problem was that i hadnt granted acess to a base when creating a personal access token.
Oct 03, 2024 11:15 AM
I found the solution, you have to add
Content-Type
application/json
in the HEADER and not as a PARAMETER
BTW I build www.wellhr.org give it a try
Oct 04, 2024 05:21 AM
Thanks @Wellhr-org!
Much appreciated