These endpoints allow you to create, edit, and delete searches.
View the official documentation here.
- search.list(callback)
- search.create([params], callback)
- search.withID(id).details([params], callback)
- search.withID(id).update([params], callback)
- search.withID(id).members(callback)
- search.withID(id).delete(callback)
Retrieve a list of saved searches.
params
<Object> Can have the following fields:deleted
<Boolean> Optional. Flag to include deleted searches.
- returns: An array of searches
Create a saved search. The detail of a search is specified in a JSON structure that describes the clauses to be applied using groups of filter type, operator and value. Where the filter type is member_field, the referenced field should be specified by joining with a colon. For example:
["and",
["or",
["group", "eq", "my list"],
["group", "contains", "old"]
],
["not", ["member_field", "soup", "eq", "lentil"]],
["opened", 123249, "between", "2011-01-22, 2011-01-31"],
["clicked", 83927]
]
params
<Object> Can have the following fields:- returns: The id of the new search.
- raises: Http404 if search is invalid.
Get the details for a saved search.
params
<Object> Can have the following fields:deleted
<Boolean> Optional. Flag to include deleted searches.
- returns: A search.
- raises: Http404 if the search does not exist.
Update a saved search. No parameters are required, but either the name or criteria parameter must be present for an update to occur.
params
<Object> Can have the following fields:- returns:
True
if update was successful. - raises: Http404 if the search does not exist or if search criteria is invalid.
Get the members matching the search.
- returns: An array of members.
- raises: Http404 if the search does not exist.
Get the details for a saved search.