How to Make an HTTP POST Request in Airtable

Aug 20, 2024Zayyad Muhammad Sani

In this tutorial, you'll learn how to send data to APIs using HTTP POST requests in Airtable.

What is an HTTP POST Request?

HTTP POST requests are used to send user-created data from a client to a server. For example, when you submit a form online or upload a photo on Instagram, the website or application uses a POST request to transfer that data to their servers.

Most web services use POST requests to create new data on their servers rather than updating them.

Why make an HTTP POST Request in Airtable?

You can use POST requests in Airtable to:

  • Send data from your Airtable base to an API. For example, you could upload new contacts to your CRM tool using their API.
  • Import data from APIs. Some APIs require you to use POST requests to fetch data instead of GET requests.

In the following sections, we'll use Data Fetcher to make a POST request in Airtable.

Installing Data Fetcher

1. Add the Data Fetcher extension to your Airtable base.

2. Once you’ve added the extension, sign in to Data Fetcher or sign up if you don’t have an account.

sign up for data fetcher.png

3. Once you've logged in to Data Fetcher, click Create your first request.

create your first request logo 2 smaller.png

How to Make an HTTP POST Request in Airtable

We'll create a POST request to send data to httpbin, a website used for trying out HTTP requests.

Follow these steps to configure the request:

1. Under Application, select Custom.

select custom request.png

2. Rename the request to something meaningful, like "Simple POST request".

rename-post-request.png

3. Select POST under Method.

post-method-post-request.png

4. Copy and paste the following URL into the URL field.

http://httpbin.org/post

url-post-request.png

If you're sending data to another API, you'll need to find out the URL they use to make POST requests.

4. Click the Body tab and enter the following text under JSON.

{  
 "name": "Data Fetcher"
}
json-body-post-request.png

You'll use the Body tab to input the information you want to send to an API. We're using JSON as the request body type here, but other APIs may require a different one. Check out the Data Fetcher help center to see the list of supported request body types and how to use them.

You can also use values from your table data in the request body.

5. Click Save and Run in the bottom right corner.

Mapping Response Fields

The POST request will run, and the Response Field Mapping screen will open. On this screen, you'll choose the fields from the API response you want to import into your table. For each field you want to import, you can choose between creating a new field in your table or using an existing one; you can also change its data type.

response-field-mapping-post-request.png

In this case, we'll import the field containing the data we sent in the request body. Every API has different response fields, so you'll need to read their documentation to know what fields to import.

1. Click Deselect all.

deselect-all-post-request.png

2. Click the "Json name" field. Scroll right or use the search bar to find the field.

jsonname-post-request.png

Data Fetcher will create a new field, "Json name", once we run the request.

3. Click Save and Run.

Check your table to see the data you imported.

result-post-request.png

Some APIs will not return any response data for POST requests. In this scenario, you can use Data Fetcher's No output mode.

Here's a summary of the steps you'll follow to make an HTTP POST request in Airtable:

  • Get the details you'll need to make a POST request from the API service you want to use.
  • Install Data Fetcher in your Airtable base.
  • Create a request in Data Fetcher.
  • Add a request body containing the data you want to send.
  • Map the response fields from the POST request.
  • Run the POST request.

That's all for this tutorial. Check out our blog to learn how to get data from APIs using Airtable and Data Fetcher.

Related Posts

How to Fetch Data from an External API in Airtable

How to Fetch Data from an External API in Airtable

Aug 19, 2024

Zayyad Muhammad Sani

Custom Requests
Connect to an API with Bearer Token Authentication in Airtable

Connect to an API with Bearer Token Authentication in Airtable

Aug 8, 2024

Zayyad Muhammad Sani

Custom Requests
How to Connect to any OAuth2 API in Airtable

How to Connect to any OAuth2 API in Airtable

Jul 22, 2024

Zayyad Muhammad Sani

Custom Requests