string
loginName
= "spread@reasonables.com";
string
loginPassword
= "TEST0000-TEST-0000-TEST-0000TEST0000";
//Create an
array of target subscriptions
string[] targetSubscriptions
= new string[2];
targetSubscriptions[1]
= "NoClone
VIP";
targetSubscriptions[2]
= "Spread
VIP";
int
interval =
-1;
int
campaignID;
//Create a Campaign
object
Campaign myCampaign
= new
Campaign();
myCampaign.campaignName
= "NoClone Promotion";
myCampaign.from = "NoClone";
myCampaign.fromEmail
=
"noclone@reasonables.com";
myCampaign.subject = "NoClone
4 is released!";
myCampaign.content
= "Download
NoClone 4 at http://noclone.net now!";
// suggest dateTime string format "yyyy-MM-ddTHH:mm:ss" ,such as "2023-02-06T12:11:21" .
myCampaign.schedule
= "2023-02-06T12:11:21";
//Create a SpreadWebService
object and use its method.
SpreadWebService MySpread = new
SpreadWebService();
campaignID
= MySpread.createCampaign (loginName, loginPassword, myCampaign, targetSubscriptions,
interval);
Dim
loginName
As String =
"spread@reasonables.com"
Dim
loginPassword
As String =
"TEST0000-TEST-0000-TEST-0000TEST0000"
'Create an array
of target subscriptions
Dim
targetSubscriptions() As String =
New
String(1) {}
targetSubscriptions(0)
= "NoClone
VIP"
targetSubscriptions(1)
= "Spread
VIP"
Dim interval
As Integer = -1
Dim campaignID
As Integer
'Create a Campaign
object
Dim myCampaign
As New Campaign
myCampaign.campaignName = "NoClone
Promotion"
myCampaign.from = "NoClone"
myCampaign.fromEmail
=
"noclone@reasonables.com"
myCampaign.subject = "NoClone
4 is released!"
myCampaign.content
= "Download
NoClone 4 at http://noclone.net now!"
' suggest dateTime string format "yyyy-MM-ddTHH:mm:ss" ,such as "2023-02-06T12:11:21" .
myCampaign.schedule
= "2023-02-06T12:11:21"
'Create a SpreadWebService
object and use its method.
Dim
MySpread
As New SpreadWebService
campaignID = MySpread.createCampaign(loginName,
loginPassword, myCampaign, _ targetSubscriptions, interval)
/**
* @name CreateCampaign
* @function create group sending campaign
* @param
* campaignargs the object of campaign you want to create.
* category the list of contacts
* interval the type of campaign.
* interval=-1, just send once.
* interval>=0,the email will be send after.
* @return
* cpnId Campaign Id
*/
public function CreateCampaign($loginEmail,$password,$campaignArgs, $category, $interval = -1 ){
$cpnArr = array(
'loginEmail' => $loginEmail,
'password' => $password,
'campaignArgs' => $campaignArgs,
'category' => $category,
'interval' => $interval
);
$Client=new SoapClient("http://service.rspread.com/Service.asmx?WSDL");
$cpnId = $Client -> createCampaign( $cpnArr );
return $cpnId;
}
POST {{YOUR_API_URL}}/service.asmx
Content-Type: application/soap+xml; charset=utf-8
Content-Length: {{length}}
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<createCampaign xmlns="http://service.reasonablespread.com/">
<loginEmail>spread@reasonables.com</loginEmail>
<password>TEST0000-TEST-0000-TEST-0000TEST0000</password>
<campaignArgs>
<campaignName>NoClone Promotion</campaignName>
<fromEmail>noclone@reasonables.com</fromEmail>
<from>NoClone</from>
<subject>NoClone 4 is released!</subject>
<content>Download NoClone 4 at http://noclone.net now!<div>html tags 😏<div></content>
<signature></signature>
<schedule>2023-02-06T12:11:21</schedule>
</campaignArgs>
<category>
<string>NoClone VIP</string>
<string>Spread VIP</string>
</category>
<interval>-1</interval>
</createCampaign>
</soap12:Body>
</soap12:Envelope>