From c7ab4d2d63356f595fa3fcd498ad297916cadff6 Mon Sep 17 00:00:00 2001 From: Andy Eschbacher Date: Fri, 9 Jan 2015 15:50:07 -0500 Subject: [PATCH] Added filename option --- doc/API.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/API.md b/doc/API.md index cdf88fc5..4bb02bdf 100644 --- a/doc/API.md +++ b/doc/API.md @@ -127,7 +127,7 @@ http://{account}.cartodb.com/api/v2/sql?q=SELECT * FROM {table_name} LIMIT 1 } ``` -Alternatively, you can use the [GeoJSON specification](http://www.geojson.org/geojson-spec.html) to return data from the API. To do so, simply supply the format parameter as GeoJSON: +Alternatively, you can use the [GeoJSON specification](http://www.geojson.org/geojson-spec.html) to return data from the API. To do so, simply supply the `format` parameter as GeoJSON:
GEOJSON
```bash @@ -161,7 +161,15 @@ http://{account}.cartodb.com/api/v2/sql?format=GeoJSON&q=SELECT * FROM {table_na } ``` -The SQL API accepts other output formats that can be useful to export data. Right now you can use the following formats: CSV, SHP, SVG, KML, GeoJSON. +The SQL API accepts other output formats that can be useful to export data. Right now you can use the following formats: CSV, SHP, SVG, KML, and GeoJSON. + +### Output filename +To customize the output filename, add the `filename` parameter to your URL: + +
Customize filename
+```bash +http://{account}.cartodb.com/api/v2/sql?filename={custom_filename}&q=SELECT * FROM {table_name} LIMIT 1 +``` ### Getting table information