Create a filter selection


https://dash.stannp.com/api/v1/selections/new

Creates an auto filter for a group.

Parameters

group_id int Mandatory. The ID of the group to associate this selection with.
name string Name your filter
filters string A specially formatted string to represent your filters. eg:

total_spent:::more_than:::300

The format is based on the following:
[column_name]:::[string_operator]:::[value]

The string operators available are: matches, contains, begins, ends, before, after, less_than, more_than, is_not.

You can chain multiple filters together like this..
total_spent:::more_than:::300:::AND:::country:::matches:::GB
Request
$ curl https://dash.stannp.com/api/v1/selections/new?api_key={API_KEY} \
-d "group_id=1" \
-d "name=update" \
-d "filters=Steve"
Return
define("API_KEY","YOUR API KEY");
$postdata = http_build_query(
  array(
  	'group_id' => "1",
  	'name' => "update",
  	'filters' => "total_spent:::more_than:::300"
  )
);
$opts = array('http' => array(
    'method'  => 'POST',
    'header'  => 'Content-type: application/x-www-form-urlencoded',
    'content' => $postdata
  )
);
$context  = stream_context_create($opts);
$result = file_get_contents("https://dash.stannp.com/api/v1/selections/new?api_key=".API_KEY, false, $context);
$response = json_decode($result,true);
print_r($response);
{
   "success":true,
   "data":[
      {
         "id":"1234"
      }
   ]
}