Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Apr 18, 2016 06:35 PM
How do I got about sorting with querystring parameters? The API documentation seems to only give an example for the ruby client.
Apr 19, 2016 06:05 AM
The url should have something like this added to the end: “&sortField=Town&sortDirection=asc”
Aug 30, 2016 10:12 AM
Since PHP is my go to language I used it to create/display the “raw” query string that should be passed in the URL to result in the appropriate GET variables/parameters on Airtable. It can be used in CURL or any thing else that can make a http request:
$sort = array(
array("field" => "My Field", "direction" => "asc"),
array("field" => "My Other Field", "direction" => "desc")
);
$params = array("sort" => $sort);
echo http_build_query($params);
This results in:
sort%5B0%5D%5Bfield%5D=My+Field&sort%5B0%5D%5Bdirection%5D=asc&sort%5B1%5D%5Bfield%5D=My+Other+Field&sort%5B1%5D%5Bdirection%5D=desc
when unescaped it is:
sort[0][field]=My Field&sort[0][direction]=asc&sort[1][field]=My Other Field&sort[1][direction]=desc