Reputation: 2553
Using the PHP API for Campaign Monitor it identifies a debug/logging level. I don't see an example for how to access or dump this log.
I'm trying to debug why an ->add($arrData) call successfully pushes information to campaign monitor, but a later call to ->get($email) returns NULL rather than a failure message or an array or header code.
What steps can I perform to debug this?
Here's what I'm trying (in the code that defines 'get' itself):
function get($email) {
echo $this->_subscribers_base_route.'.json?email='.urlencode($email).'<br />';
$response = $this->get_request($this->_subscribers_base_route.'.json?email='.urlencode($email));
echo file_get_contents('php://input');
echo '<br />';
var_dump($response);
return $response;
//return $this->get_request($this->_subscribers_base_route.'.json?email='.urlencode($email));
}
This is what's returning NULL. The same params are provided for instantiation in the case of add and get.
I'm stuck for a good starting point to debug.
Any thoughts would be appreciated.
Thanks
Upvotes: 1
Views: 191
Reputation: 1660
The call to file_get_contents
will dump the body of the currently executing HTTP request, i.e the request executing on your server. This will be empty if it's a GET request and the posted data if a POST request. This WILL NOT dump any data relating to the call to the Campaign Monitor API.
The wrapper can log debugging information relating to the api request. You can enable logging by constructing the wrapper object in the following manner
$wrap = new CS_REST_Subscribers('Your list ID', 'Your API Key', 'https', CS_REST_LOG_VERBOSE);
This will echo the data sent and received in the call.
If you're still having trouble get in touch with support, including your API Key and code making use of the wrapper.
Upvotes: 2