I’m having issues with the Airtable API in the Shortcuts app. I can get records using maxRecords
but can’t filter by fields.
Here’s what works:
https://api.airtable.com/v0/MyBase/MyTable?maxRecords=3
But when I try to use the fields
parameter like this:
https://api.airtable.com/v0/MyBase/MyTable?fields=['Column1']
I get an error about invalid request and parameter validation. I’ve checked the docs but can’t figure out what’s wrong. Any ideas on how to properly filter by fields using the Airtable API in Shortcuts? Thanks for any help!
I’ve encountered similar issues when working with the Airtable API in Shortcuts. The problem is likely due to how Shortcuts handles URL encoding for special characters. Here’s what worked for me:
Instead of using square brackets, try using parentheses and remove the quotes around the field name. So your URL should look like this:
https://api.airtable.com/v0/MyBase/MyTable?fields=(Column1)
If you need to filter by multiple fields, separate them with commas:
https://api.airtable.com/v0/MyBase/MyTable?fields=(Column1,Column2,Column3)
This format seems to play nicer with Shortcuts’ URL handling. Also, make sure you’re using the correct field names exactly as they appear in your Airtable base. Hope this helps solve your issue!
hey there! i’ve run into this too. shortcuts can be finicky with airtable api. try using percent encoding for the brackets:
https://api.airtable.com/v0/MyBase/MyTable?fields[]=Column1
that should work better. if u need multiple fields just add more like this:
?fields%5B%5D=Column1&fields%5B%5D=Column2
hope that helps!
I’ve dealt with this exact problem before. The issue lies in how Shortcuts handles URL encoding. A workaround that’s worked consistently for me is to use URL encoding for the special characters in your API call. Try this format:
https://api.airtable.com/v0/MyBase/MyTable?fields[]=Column1
The %5B and %5D are the URL-encoded versions of square brackets. If you need multiple fields, just repeat the pattern:
https://api.airtable.com/v0/MyBase/MyTable?fields[]=Column1&fields[]=Column2
This method has been reliable in my experience with Shortcuts and Airtable API integration. Let me know if you encounter any other issues.