Description
Use this feature to retrieve dispatch statistics about a newsletter. You will get the same information as using the menu item “Newsletter – Statistics” in the administrator surface. Amongst other information the amount of newsletters successfully delivered and the amount of recipients that were excluded (including the reason) are displayed. You can either look for a specific newsletter or provide a period of time to see all applicable statistics in this period. Backclick searches for the corresponding newsletter(s) and returns the related statistics.
Available starting from Backclick-Version: 5.7.5
In order to retrieve the statistics you have to provide the following information:
- Mandator ID
- API-Key (optional authentication, if not provided the IP address will be used for authentication)
- Newsletter you want to retrieve information for (you either have to provide a list of newsletter IDs or the period of time you need the statistics for)
- List of newsletter IDs
- Period of time
- ID of mailing list you want to be searched
- Period of time to be searched in
You will retrieve a structured object containing all information as a result.
The following error messages can occur in faulty requests:
- Error getting Newsletter-List-ID => The mailing list provided does not exist
Example
$client = new SoapClient($wsdlUrl);
$newsletterStatisticRequest = new StdClass();
$newsletterStatisticRequest->mandatorId = 0;
$newsletterStatisticRequest->newsletterIds = array(1);
try {
$result = $client->NewsletterStatistic($newsletterStatisticRequest);
var_dump($result);
} catch (Exception $e) {
echo "Fehler aufgetreten: " . $e->getMessage() . "\r\n";
}
object(stdClass)#3 (1) {
["newsletterStatistic"]=>
object(stdClass)#4 (26) {
["newsletterId"]=>
int(1)
["newsletterListId"]=>
int(1)
["newsletterStatus"]=>
int(3)
["mailsPerHour"]=>
int(1800)
["mailsPerHourIncludeErrors"]=>
int(203)
["sendStartTime"]=>
string(29) "2012-10-29T11:13:00.000+01:00"
["sendBeginTime"]=>
string(29) "2012-10-29T11:14:34.000+01:00"
["sendLastTime"]=>
string(29) "2012-10-29T11:15:27.000+01:00"
["sendEndTime"]=>
string(29) "2012-10-29T11:14:40.000+01:00"
["sendedByInternalMta"]=>
bool(true)
["newsletterListName"]=>
string(15) "Testverteiler 1"
["newsletterSubject"]=>
string(22) "Newslettertest"
["newsletterDescription"]=>
string(22) "Newslettertest"
["numErrorHandlingActive"]=>
int(0)
["numRecipientsUnadjusted"]=>
int(6)
["numRecipientsAdjusted"]=>
int(3)
["numSend"]=>
int(3)
["numSuccess"]=>
int(3)
["sendDuration"]=>
int(6)
["sendDurationIncludeErrors"]=>
int(53)
["numTemporaryErrors"]=>
int(0)
["numPermanentErrors"]=>
int(0)
["numTemporaryDomainErrors"]=>
int(0)
["numPermanentDomainErrors"]=>
int(0)
["numUnhandledErrors"]=>
int(0)
["invalidSubscriberInfo"]=>
object(stdClass)#5 (10) {
["invalidTargetGroupSubsscribers"]=>
int(0)
["numSubscribersRemoved"]=>
int(0)
["invalidEmails"]=>
int(0)
["blockedByTempRobinson"]=>
int(2)
["blockedByExternalRobinson"]=>
int(0)
["blockedByProfileFilter"]=>
int(0)
["blockedByBackclickFilter"]=>
int(0)
["blockedByNewsletterLists"]=>
int(0)
["blockedByComplaintList"]=>
int(0)
["blockedByFreeRobinsonList"]=>
int(0)
}
}
}
$client = new SoapClient($wsdlUrl);
$newsletterStatisticRequest = new StdClass();
$newsletterStatisticRequest->mandatorId = 0;
$newsletterStatisticRequest->newslettersInPeriod = new StdClass();
$newsletterStatisticRequest->newslettersInPeriod->newsletterListId = 1;
$newsletterStatisticRequest->newslettersInPeriod->timePeriod = new StdClass();
date_default_timezone_set('Europe/Berlin');
$newsletterStatisticRequest->newslettersInPeriod->timePeriod->startTime = mktime(13, 10, 0, 10, 30, 2012);
$newsletterStatisticRequest->newslettersInPeriod->timePeriod->endTime = mktime(13, 19, 0, 10, 30, 2012);
try {
$result = $client->NewsletterStatistic($newsletterStatisticRequest);
var_dump($result);
} catch (Exception $e) {
echo "Fehler aufgetreten: " . $e->getMessage() . "\r\n";
}
Source code
In order to test a working example you can download the source code.
Example for requesting Newsletter-Statistics