Description
This feature grants you the possibility to import or update subscribers as a Batch-Job into Backclick.
Compared to the feature Add/Update Subscribers this feature offers the possibility to transfer thousands of datasets to Backclick in a single request.
While importing you can create or update a profile filter at the same time in order to invoke the feature Newsletter-Dispatch (II) afterwards and send a newsletter to the subscribers you just imported.
The subscriber data have to be arranged like a Backclick Import-File. This means that all columns have to be separated with a tabulator and each row may only contain a single dataset.
The corresponding fields from Backclick have to be located in the first row, written in the usual syntax (capital letters only).
When invoking the interface multiple times it is possible that the notification “Another auto import is running. Please try again later.” appears. This is the case when a Batch-Import was already started. In a case like this the feature has to be invoked over and over again until the import has finished (the error message will not appear anymore).
Available starting from Backclick-Version: 5.8.0
In order to invoke the subscriber import you have to provide the following information:
- Mandator ID
- API-Key (optional authentication, if not provided the IP address will be used for authentication)
- Mailing list IDs the subscribers are supposed to be imported into
- Subscriber data
- Information whether a profile filter is supposed to be created (default: “createFilter” => false) optional
- Information which filter is supposed to be expanded (default: “filterToUpdate” => 0) optional
An Object, including the ID of the filter created or updated will be the result. If you did not create or update a filter, the result will always be 0.
When using this feature the following error messages can occur in a faulty request:
- Another auto import is running. Please try again later.
- No data for import given.
- No list IDs given in import.
- Should I create or update a filter? => You want to create a new filter, but specified the ID of a filter to be expanded at the same time.
- Filter with ID #x is non existent
- Could not create import file => An error occurred while creating the temporary file
Example
$client = new SoapClient($wsdlUrl);
$importSubscribersRequest = new StdClass();
$importSubscribersRequest->mandatorId = 0;
$importSubscribersRequest->newsletterListIds = array(1);
$importSubscribersRequest->createFilter = true;
$importData = utf8_encode("EMAIL\tVORNAME\tNACHNAME\r\n");
for ($i = 0; $i < 10; $i++) {
$importData = $importData . utf8_encode("user-" . $i . "@example.com\tVorname-" . $i . "\tNachname-" . $i . "\r\n");
}
$importSubscribersRequest->importData = $importData;
try {
$result = $client->importSubscribers($importSubscribersRequest);
var_dump($result);
} catch (Exception $e) {
echo "Fehler aufgetreten: " . $e->getMessage() . "\n";
}
object(stdClass)#3 (1) {
["filterId"]=>
int(1)
}
Source code
In order to test a working example you can download the source code.
Example for importing subscribers