- if (empty($params['contact_id'])) {
- return civicrm_api3_create_error('contact_id is a required field');
- }
-
- if (empty($params['type'])) {
- $params['type'] = 'Delivered';
- }
-
- $validTypeValues = array('Delivered', 'Bounced');
- if (!in_array($params['type'], $validTypeValues)) {
- return civicrm_api3_create_error(
- 'type should be one of the following: ' .
- implode(', ', $validTypeValues)
- );
- }
-
- if (!isset($params['offset'])) {
- $params['offset'] = 0;
- }
-
-
- if (!isset($params['limit'])) {
- $params['limit'] = 50;
+ return civicrm_api3_create_success(_civicrm_api3_mailing_contact_getresults($params, FALSE));
+}
+/**
+ * This is a wrapper for the functions that return the results from the 'quasi-entity'
+ * mailing contact
+ * @param array $params
+ * @param Boolean $count
+ * @throws Exception
+ */
+function _civicrm_api3_mailing_contact_getresults($params, $count){
+ if(empty($params['type'])){
+ //ie. because the api is an anomoly & passing in id is not valid
+ throw new Exception('This api call does not accept api as a parameter');