Hi,
I don't have an example that doesn't use a file right now, but this code will import a file using one of the bulk import functions in the PHP SDK.
define("APIKEY", "xxx");
define("ACCESS_TOKEN", "xxx");
$cc = new ConstantContact(APIKEY);
try {
$listID = "xxx"; //insert your list ID
$directory = __DIR__ . '/new list';
$fileName = 'test.csv'; //change to your fileName
$contents = file_get_contents($directory . '/' . $fileName);
$fillList = $cc->addCreateContactsActivityFromFile(ACCESS_TOKEN, $fileName, $contents, $listID);
} catch (CtctException $ex) { //catch & print exceptions
print json_encode(array('status'=>'failure', 'message'=>$ex->getMessage()));
}
You might consider catching the errors from your script to see what the problem is, if you don't want to use a file. I hope that helps!
Best Regards,
Shannon Wallace
Partner API Support Engineer
... View more