Create A Proxy


Proxy allows you to make API calls and communicate with third-party APIs in your Airtable Scripting block that requires Headers or have CORS disabled. You can use multiple HTTP methods, add URL parameters, and store Header Keys and Values.

Learn more about On2Air: Storage



In this article:

Create a New Proxy
Incoming
Outgoing
Make a Request in Airtable
Proxy Settings

Create a New Proxy

Click Create new Proxy

Incoming

On the Incoming tab, specify your Incoming Requesting Method
Options:
 GET
 POST

Under URL Parameters, click Add new option to define URL Parameters
In this example, we use the ‘search’ parameter

Select Refresh Code to generate a new code



An Incoming URL is automatically generated

The Incoming URL will be the URL used in your Airtable Scripting block

Outgoing

Outgoing allows our API to connect to the third-party API.

In the Outgoing tab, add your API Endpoint URL
In this example, we add the Star Wars API Endpoint for ‘People’

Select the Incoming Parameters dropdown to choose your Parameter
In this example, {search} is the parameter

It will automatically be added to the end of your URL

Specify your Outgoing Request Method
Options:
GET
POST
PUT
PATCH
DELETE

Specify your Outgoing Response Format
Options:
JSON
TEXT
BUFFER



If needed, add Outgoing Headers containing your Header Key and Value to prevent exposing it in the client

If your Outgoing Request Method is POST or PUT, you can submit a body of text by using the text field

If your Incoming URL is a POST, select the Incoming Body toggle
The content will be forwarded to your Outgoing URL

If needed, add Incoming Headers and select the Incoming Header toggle



Make a Request in Airtable

Add the following code in your Scripting block

Proxy Example

let res, answer
res = await fetch('https://storageapi.o2adev.com/api/proxy/GET/JGqFZReI?search=r2')
answer = await res.json()
output.markdown('## Proxy Result')
output.inspect(answer)


In the example below, we are using the Star Wars API. We have added the {search} parameter and will {search} 'r2'.



Proxy Settings

Delete

If you no longer want a Proxy, click Delete Proxy

Verify deletion by clicking Yes, I want to delete this Proxy
WARNING: Deleting a data pair cannot be undone

Was this article helpful?
Cancel
Thank you!