Filters are created by sending include
, exclude
, and base
to /filters/create. You can use GET for rapid prototyping, or POST when the amount of data you're sending grows too large for a GET.
base
specifies a filter to use as a template. It is the "default" filter, by default. A blank slate can be achieved by using "none".
include
and exclude
contain semi-colon delimited lists of fields to add or remove from the base
filter. For example, include=.total;question.body
says to return the total
field on the common wrapper object and question bodies (provided you call a method that returns questions, naturally).
We provide a utility in the console on every method page (see /questions for example) to make building filters easier.
When you save, the created filter will be placed where the "editing..." box is.
...filters should be pre-calculated and "baked in" in the common cases
Simply means that the vast majority of applications shouldn't call /filters/create as part of their normal operation. An apps developer should have pre-calculated the filters the app needs, and hard-coded them in basically. Note, filters are immutably and non-expiring so this "bake in" is perfectly safe.