Problem with POST to create a new record in airtable

1479 1
Showing results for 
Search instead for 
Did you mean: 
4 - Data Explorer
4 - Data Explorer

Hello, I´m new using airtable.

I´m developing a Labview-based software for reading information from airtable and writing information to airtable. 

I have no problem with reading from airtable. I´m using the functions in labview for inserting the headers with Authorization, then I encode the URL for retrieving the information I want, and use the Get function. This point has no problem.

The problem is that I´m not being able to create a new record in the table. Basically, I´m following the same flow as before. I´m inserting the header with the Authorization, then I´m generating the URL with the Base ID  and the Table name, then I´m using the function POST which has as inputs the URL and the data to send to the airtable.

The data I´m sending is this one:

{"fields":{"Test Number":67,"CH - Pass / Fail":"Pass"}}


As answer I receive the following header:

HTTP/1.1 422 Unprocessable Entity
Date: Sat, 24 Dec 2022 10:32:17 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 127
Connection: keep-alive
Set-Cookie: AWSALB=ty5kXd3tYP9WQ3tYNsxGSMSIPh+LKuA61DluV4f3emR3CzZD9Zo9iCF5z1Yxue7UPdhUG6nBKFxQzEPIHHM6HLtV3A7WuwJ2pJPUlUku6LpYqWy9dp6UEEG6+TPS; Expires=Sat, 31 Dec 2022 10:32:17 GMT; Path=/
Set-Cookie: AWSALBCORS=ty5kXd3tYP9WQ3tYNsxGSMSIPh+LKuA61DluV4f3emR3CzZD9Zo9iCF5z1Yxue7UPdhUG6nBKFxQzEPIHHM6HLtV3A7WuwJ2pJPUlUku6LpYqWy9dp6UEEG6+TPS; Expires=Sat, 31 Dec 2022 10:32:17 GMT; Path=/; SameSite=None; Secure
Server: Tengine
Set-Cookie: brw=brwCKP3jH21Q0yPus; path=/; expires=Sun, 24 Dec 2023 10:32:17 GMT;; samesite=none; secure
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
access-control-allow-origin: *
access-control-allow-methods: DELETE,GET,OPTIONS,PATCH,POST,PUT
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
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
ETag: W/"7f-ic7Ppjtti07fW0oQKWhpH6lrz8A"
Vary: Accept-Encoding


and the following  body:

{"error":{"type":"INVALID_REQUEST_UNKNOWN","message":"Invalid request: parameter validation failed. Check your request data."}}

I tried to find a solution by myself on the internet, but I had not been successful in this task. I have been trying for three days an nothing. 

Could somebody please give me a hint about what is happening and how could I solve this problem?







1 Reply 1
4 - Data Explorer
4 - Data Explorer

I solved the issue. Will post the problem here in case it could be helpful for someone.

The problem in my case is that I was using the header 

"Content-Type: application/json"

And I should be instead the header

"Content-Type: application/json; charset=UTF-8"

Now it is working properly