string
loginName
= "spread@reasonables.com";
string
loginPassword
= "TEST0000-TEST-0000-TEST-0000TEST0000";
string
customerEmail
= "test@reasonables.com";
string
targetSubscription
= "NoClone
VIP";
DoubleOptIn addOption = DoubleOptIn.Off;
bool
confirmIsNeeded;
//Create a Subscriber
object
Subscriber customer =
new Subscriber();
customer.email =
"test@reasonables.com";
customer.firstName =
"Alan";
customer.lastName =
"Wo";
customer.company =
"Reasonable Software";
//Create a SpreadWebService
object and use its method.
SpreadWebService MySpread = new
SpreadWebService();
confirmIsNeeded
= MySpread.addSubscriberByInfo (loginName, loginPassword, customer, targetSubscription, addOption);
Dim
loginName
As String =
"spread@reasonables.com"
Dim
loginPassword
As String =
"TEST0000-TEST-0000-TEST-0000TEST0000"
Dim
targetSubscription As String =
"NoClone VIP"
Dim addOption
As
DoubleOptIn
= DoubleOptIn.Off
Dim confirmIsNeeded
As Boolean
'Create a subscriber
object
Dim customer
As New Subscriber
customer.email = "test@reasonables.com"
customer.firstName = "Alan"
customer.lastName
=
"Wo"
customer.company = "Reasonable
Software"
'Create a SpreadWebService
object and use its method.
Dim
MySpread
As New SpreadWebService
confirmIsNeeded = MySpread.addSubscriberByInfo(loginName,
loginPassword, customer, _ targetSubscription, addOption)
/**
* @name addSubscriberByInfo
* @function add single subscriber's email address
* @param
* optInType 'Off'
* data receiver data
* (array import)
* $data = array(
* 'email' => 'spread@reasonables.com', (required)
* 'firstName' => 'spread', (optional)
* 'lastName' => 'siqi', (optional)
* 'date1' => date( 'c' ) (optional, current time)
* 'date2' => date( 'c' ) (optional, current time)
* ...... => ......
* );
* @return
* errorMsg failed message
* Msg success message
*/
public function addSubscriberByInfo($loginEmail,$password,$data,$listName,$optInType){
$addInArr = array(
'loginEmail' => $loginEmail,
'password' => $password,
'subscriberArgs' => $data,
'subscription' => $listName,
'optInType' => $optInType
);
$Client = new SoapClient("http://service.rspread.com/Service.asmx?WSDL");
$errorMsg = $Client -> addSubscriberByInfo( $addInArr );
return $errorMsg;
}
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>
<addSubscriberByInfo xmlns="http://service.reasonablespread.com/">
<loginEmail>spread@reasonables.com</loginEmail>
<password>TEST0000-TEST-0000-TEST-0000TEST0000</password>
<subscriberArgs>
<email>test@reasonables.com</email>
<firstName>Alan</firstName>
<lastName>Wo</lastName>
<company>Reasonable Software</company>
<date1>2023-02-06T12:11:21</date1>
<date2>2023-02-06T12:11:21</date2>
<customField1>string</customField1>
</subscriberArgs>
<subscription>NoClone VIP</subscription>
<optInType>Off</optInType>
</addSubscriberByInfo>
</soap12:Body>
</soap12:Envelope>