Help

Save the date! Join us on October 16 for our Product Ops launch event. Register here.

Calling async API endpoints from a custom extension?

Topic Labels: Custom Extensions
Solved
Jump to Solution
966 2
cancel
Showing results for 
Search instead for 
Did you mean: 
yoblin
4 - Data Explorer
4 - Data Explorer

I'm creating a new extension that will automatically update records in a table based on data returned from a server API endpoint that I control.

This API computes a lot of data and will take longer than 30 seconds to respond, so this can't be a normal synchronous API call.

What is the best strategy for doing this in my extension? I can think of three possible ways -

* Can extensions listen for webhooks, where I call an API and get a webhook back some minutes later?
* Or maybe the server writes directly to the table when the data is ready - can an extension facilitate this automatically?
* Alternatively, can I have my extension automatically & continuously (without user interaction) poll an endpoint every hour for new data and update the table?

Thanks for your ideas!

1 Solution

Accepted Solutions
Devinder_Singh
6 - Interface Innovator
6 - Interface Innovator

I am unsure about options 1 and 3, but 2 is straightforward and will work.

  1. The extension calls the server API with all the required data. This API should be async, as you mentioned.
  2. Once the processing is complete, the server calls Airtable API to update the table. You don't need the extension to do anything here. The extension's role is just to call your async API.

 

See Solution in Thread

2 Replies 2
Devinder_Singh
6 - Interface Innovator
6 - Interface Innovator

I am unsure about options 1 and 3, but 2 is straightforward and will work.

  1. The extension calls the server API with all the required data. This API should be async, as you mentioned.
  2. Once the processing is complete, the server calls Airtable API to update the table. You don't need the extension to do anything here. The extension's role is just to call your async API.

 

Ah - that makes sense. The user installs the extension, then does the OAuth flow so that I can send async updates.

It looks like that is what e.g. Data Fetcher does, based on their docs.