POST to Airtable


#1

I feel like a am missing a simple piece of info. A lot of the tutorials show how to use Airtable as a DB to provide text, pictures and other info for use in an Intuiface experience. But I don’t understand how to POST a new record into the Airtable. I am simply trying to gather some mailing list info and when the user presses a button a new record is written. I can’t tell what Action causes the POST action to take place. When I look into the API X-Ray all of my properties are Read-Only.


Am I doing something wrong in the API Explorer when I connect my Airtable? Is there a step by step on connecting an Airtable to Intuiface where I never need to see the info on screen? I am simply writing records to a spreadsheet.


#2

Hello Greg,

You may want to check this article, especially the § Create a JSON body for your request paragraph.

Also check the sample that Airtable is giving you in the API Documentation for your base, paragraph § Create a record that should look like this:

$ curl -v -XPOST https://api.airtable.com/v0/appx7grJFp69q7OA6/Foobar \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-type: application/json" \
 -d '{
  "fields": {
    "Text to display": "main screen",
    "Notes": [
      {
        "url": "https://dl.airtable.com/TcGCuyNBSfSbgwDS7UIF_Dessert-1.jpg"
      }
    ],
    "Timestamp": "2018-05-11T16:05:00.000Z"
  }
}'

By combining both you will be able to create a record in your Airtable base with Intuiface.

Regards.

Alex.


#3

Hi @kneselg,

In addition to @Alex’s comment, did you check the Actions part of your Interface Asset?
With POST or GET requests, you can make this POST action to take place by explicitly calling the action from the trigger of your choice. See below.