Trying to use a curl GET from excel VBA 2011 Mac to grab some records. Took me a while to figure out how to get authentication to work, did that, but have hit another bump.
I am copying the GET syntax directly from Paw which returns the correct results. In excel the same syntax does not return the same results. It seems I can only manage to pass a single filter to Airtable.
This code will return ALL records in the Stunning view of BestTableEver.
“curl -X GET --header ‘Authorization: Bearer keyYour_Bearer_Key’ https://api.airtable.com/v0/appYour_Fabs_App/BestTableEver?view=Stunning&maxRecords=1”
This code will return a single record from BestTableEver that is actually filtered out of the Stunning view, but is the first record you get from Paw without naming the view.
“curl -X GET --header ‘Authorization: Bearer keyYour_Bearer_Key’ https://api.airtable.com/v0/appYour_Fabs_App/BestTableEver?maxRecords=1&view=Stunning”
I should note I am using the execShell() function courtesy of Robert Knight via StackOverflow to make the actual call.
And after a little digging here… https://curl.haxx.se/docs/manpage.html I am thinking the problem may be with the “&” after the first filter.
I’ve tried encoding with https://codepen.io/airtable/pen/rLKkYB. As near as I can tell it is a limitation of the curl client in OSX, or possibly with the shell function I am passing the curl command through. Anyway it seems like it does not pass anything after the & in the curl GET. Also Patch and Post aren’t in the curl client. So… on to Node.js
Curl client on OS X generally works fine. That’s what we use to test out examples in the docs.
Make sure you have single quotes around the URL that gets passed to the shell. If you don’t, the shell will interpret & as ending of command and sending the command to the background.