I'm trying to integrate MailChimp API. I've switched out two different libraries and getting the same error.
[type] => http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/
[title] => Resource Not Found
[status] => 404
[detail] => The requested resource could not be found.
[instance] =>
Unfortunately this error doesn't provide me any usable information. The library I'm using is this one.
Here's the code I'm using in my controller:
function __construct(){
parent::__construct();
$this->load->library('mailchimp');
$this->common = array(
'list_id' => '12345678',
);
}
public function signup() {
$form = $this->input->post();
if ( !empty($form['website']) ) {
// If Honey Pot is filled out
redirect('https://www.google.com');
} else {
$result = $this->mailchimp->call('POST',
'lists/'.$this->common['list_id'].'/members',
array(
'email_address' => $form['email'],
'merge_fields' => array(
"FNAME" => $form['first_name'],
"LNAME" => $form['last_name']
),
'status' => 'subscribed',
)
);
debug($result);
return true;
// Check Result
if ( $result['status'] !== 'subscribed' && $result['status'] !== 'pending' ) {
return false;
} else {
return true;
}
}
}
The debug
function is a helper I have that does a print_r
wrapped in <pre>
to make my life easier.
I'm hoping this is just a case of staring at the screen too long and missing the obvious or there's something amiss with the MailChimp API.