airtable-php icon indicating copy to clipboard operation
airtable-php copied to clipboard

Accelerated need to limit large url requests to “list records”, with alternative POST version

Open FredZhao-at opened this issue 2 years ago • 0 comments

Hi! Fred here again, from the Airtable API team. Another update is that as part of recent infrastructure improvements to airtable.com, we needed to accelerate enforcement of rejecting any requests whose request URLs exceed 16k characters. The changes described below are in effect today.

  • Q: What endpoints does this affect?
    • The 16k character limit applies to all current and future API request URLs
    • Based on our internal audit of current usage, this primarily impacts the “list records” endpoint, which is a GET request to /v0/{baseId}/{tableIdOrName} (https://airtable.com/developers/web/api/list-records)
  • Q: What is the impact of this change?
    • The vast majority of our API requests have remained well under the 16k character limit, and would not be affected
    • However, requests exceeding this limit will now be rejected, so we expect some calls to now require an update to handle the large cases. For example, requests whose query parameter for filterbyFormula is long enough to make the overall URL length to exceed that character limit
    • Therefore, we recommend either switching entirely to the alternative detailed below, or switching to it when you can detect that a request URL will exceed the 16k character limit
  • Q: What is the alternative?
    • APIs can instead make a POST request to /v0/{baseId}/{tableIdOrName}/listRecords, and encode the query params as the body of that POST request. We currently still require two parameters to remain as query params, timeZone and userLocale; you can see the full details and examples here: https://support.airtable.com/docs/enforcement-of-url-length-limit-for-web-api-requests
  • Q: Why the urgency for this change?
    • I apologize for the inconvenience due to the accelerated timeline here. While we originally planned to start this enforcement in January 2023, we needed to deploy this change recently this week, as part of required infrastructure improvements to maintain the stability of our public API

FredZhao-at avatar Dec 14 '22 23:12 FredZhao-at