WDSL guide parts generation and shipments
This module includes all the services required for the creation of Parts and/or Shipments.
Create Part
Allows you to generate a new Newsletter (Part) in the system.
Petition
URL:
*platformdomain must be replaced by the URL of the instance
WebService:
Request Parameters
Request Response -> Results
Object with the following structure (JSON) ->
List of Response Codes
PHP Example
require_once('lib/nusoap.php');
date_default_timezone_set('UTC');
$proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : '';
$proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : '';
$proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : '';
$proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : '';
$useCURL = isset($_POST['usecurl']) ? $_POST['usecurl'] : '0';
$client = new nusoap_client('http://domain.icommarketing.com/Newsletters.asmx?WSDL','wsdl','','','','');
$err = $client->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
exit();
}
$client->setUseCurl($useCURL);
$html = 'HTML';
$html = utf8_decode($html);
$param = Array(
"ApiKey"=>"API_KEY",
"UserName"=>"UserName",
"Campaign"=>"Campaign Name",
"NewsletterName"=>"Newsletter Name",
"Content"=>$html,
"PlainText"=>"test"
);
$result = $client->call('CreateHTML',$param,",",false,true);
// Check for a fault
if ($client->fault) {
echo '<h2>Fault</h2><pre>';
print_r($result);
echo '</pre>';
} else {
// Check for errors
$err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Error</h2><pre>' . $err . '</pre>';
} else {
echo '<h2>Result</h2><pre>';
$auxresponse = json_decode($client->responseData);
echo '<pre>StatusCode' . $auxresponse->{'StatusCode'} . '</pre>';
echo '<pre>Message' . $auxresponse->{'Message'} . '</pre>';
echo '<pre>MessageDetail' . $auxresponse->{'MessageDetail'} . '</pre>';
echo '<pre>Data' . $auxresponse->{'Data'} . '</pre>'; }
}
Create Shipment
It allows triggering a new delivery from the instance, detailing the content to be sent and the audience to which it will be addressed.
Petition
URL
http://dominioplataforma.icommarketing.com/Deliveries.asmx?WSDL*platformdomain must be replaced by the URL of the instance
WebService
CreateConfigurationRequest Parameters
Request Response -> Results
Object with the following structure (JSON) ->
StatusCode: Operation Result CodeMessage: Text of the result of the operationMessageDetail: Details of the error message when it occursData: Additional informationList of Response Codes
PHP Example
require_once('lib/nusoap.php');
date_default_timezone_set('UTC');
$proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : '';
$proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : '';
$proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : '';
$proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : '';
$useCURL = isset($_POST['usecurl']) ? $_POST['usecurl'] : '0';
$client = new nusoap_client('http://domain.icommarketing.com/Deliveries.asmx?WSDL','wsdl','','','','');
$err = $client->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
exit();
}
$client->setUseCurl($useCURL);
$html = 'HTML';
$html = utf8_decode($html);
$param = Array(
"ApiKey"=>"API_KEY",
"UserName"=>"UserName",
"Campaign"=>"Campaign Name",
"NewsletterName"=>"Newsletter Name",
"Content"=>$html,
"PlainText"=>"test",
"FromMail"=>"newsletter@dominionews.com",
"FromName"=>"FromName",
"Subject"=>"Subject",
"ReplyMail"=>" newsletter-reply@dominionews.com ",
"Profiles"=>"PROFILE_KEY1, PROFILE_KEY1",
"StartDate"=>"2014-06-06T17:30:00.000",
"ViralMarketing"=>"true",
"SocialNetworks"=>"1,2,3,4,5",
"Testing"=>"false",
"PreHeader"=>"PreHeader",
"SendGoogleAnalyticsData"=>"true"
);
$result = $client->call('CreateConfiguration',$param,",",false,true);
// Check for a fault
if ($client->fault) {
echo '<h2>Fault</h2><pre>';
print_r($result);
echo '</pre>';
} else {
// Check for errors
$err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Error</h2><pre>' . $err . '</pre>';
} else {
echo '<h2>Result</h2><pre>';
$auxresponse = json_decode($client->responseData);
echo '<pre>StatusCode' . $auxresponse->{'StatusCode'} . '</pre>';
echo '<pre>Message' . $auxresponse->{'Message'} . '</pre>';
echo '<pre>MessageDetail' . $auxresponse->{'MessageDetail'} . '</pre>';
echo '<pre>Data' . $auxresponse->{'Data'} . '</pre>'; }
}
Create Submission w/Pre-existing News
Allows you to trigger a new shipment from the instance, using a previously created part.
Petition
URL
*platformdomain must be replaced by the URL of the instance
WebService
Request Parameters
Request Response -> Results
Object with the following structure (JSON) ->
List of response codes
PHP Example
require_once('lib/nusoap.php');
date_default_timezone_set('UTC');
$proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : '';
$proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : '';
$proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : '';
$proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : '';
$useCURL = isset($_POST['usecurl']) ? $_POST['usecurl'] : '0';
$client = new nusoap_client('http://domain.icommarketing.com/Deliveries.asmx?WSDL','wsdl','','','','');
$err = $client->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
exit();
}
$client->setUseCurl($useCURL);
$html = 'HTML';
$html = utf8_decode($html);
$param = Array(
"ApiKey"=>"API_KEY",
"UserName"=>"UserName",
"Campaign"=>"Campaign Name",
"NewsletterName"=>"Newsletter Name",
"FromMail"=>"newsletter@dominionews.com",
"FromName"=>"FromName",
"Subject"=>"Subject",
"ReplyMail"=>" newsletter-reply@dominionews.com ",
"Profiles"=>"PROFILE_KEY1, PROFILE_KEY1",
"StartDate"=>"2014-06-06T17:30:00.000",
"ViralMarketing"=>"true",
"SocialNetworks"=>"1,2,3,4,5",
"Testing"=>"false",
"PreHeader"=>"PreHeader",
"SendGoogleAnalyticsData"=>"true"
);
$result = $client->call('CreateConfigurationWithExistingNews',$param,",",false,true);
// Check for a fault
if ($client->fault) {
echo '<h2>Fault</h2><pre>';
print_r($result);
echo '</pre>';
} else {
// Check for errors
$err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Error</h2><pre>' . $err . '</pre>';
} else {
echo '<h2>Result</h2><pre>';
$auxresponse = json_decode($client->responseData);
echo '<pre>StatusCode' . $auxresponse->{'StatusCode'} . '</pre>';
echo '<pre>Message' . $auxresponse->{'Message'} . '</pre>';
echo '<pre>MessageDetail' . $auxresponse->{'MessageDetail'} . '</pre>';
echo '<pre>Data' . $auxresponse->{'Data'} . '</pre>'; }
}
Updated on: 02/02/2024
Thank you!