I have a test drive for Mailchimp API v3 using your PHP shell. It works great for me. But when I create a request using POST to create a "Create Segment", you will get an error message (attach a screenshot):
Request code (through an associative array) -
$api_key = "xxxxxxxxxxxxxxxx-us11"; $list_id = "1xx2xx3xx4xx"; $MailChimp = new MailChimp($api_key); $result = $MailChimp->post('lists/' . $list_id . '/segments', array('name' => 'Testing Data', 'options' => array('match' => 'all', 'conditions' => array('field' => 'type', 'op' => 'is', 'value' => 'Testing')) ));
This call request returns the following error -
array (size = 2) 'field' => string 'options.conditions' (length = 18) 'message' => string 'The scheme describes the array, the found object instead of' (Length = 44)

I will also try to create a Request (via an associative array) -
Method 1:
$api_key = "xxxxxxxxxxxxxxxx-us11"; $list_id = "1xx2xx3xx4xx"; $MailChimp = new MailChimp($api_key); $result = $MailChimp->post('lists/' . $list_id . '/segments', array('name' => 'Testing Data', 'options' => array('match' => 'all', 'conditions' => array(array('field' => 'type', 'op' => 'is', 'value' => 'Testing'))) ));
Method 2:
$api_key = "xxxxxxxxxxxxxxxx-us11"; $list_id = "1xx2xx3xx4xx"; $MailChimp = new MailChimp($api_key); $result = $MailChimp->post('lists/' . $list_id . '/segments', array('name' => 'Testing Data 4', 'options' => array('match' => 'all', 'conditions' => array(array('field' => 'type'), array('op' => 'is'), array('value' => 'Testing'))) ));
Both methods will create a segment on the mailchimp account, but will not have any conditions. See screenshot -

How to fix this problem?