Update a Contact
Update a Contact
Function
updateContact()
Parameters
- username:
String
- Account login name.
- password:
String
- Account password.
- contactId:
long
- email/contact to set the opt-out status for
- optOut:
boolean
- set opted out or not.
- emailBounced:
boolean
- set email Bounced or not.
- clearField:
boolean
- set clear field flag,
if (clearField is true && newValue[i] is Empty)
=>clear
this Field's value,if (clearField is false)
=> set those newValues which are not empty.
- set clear field flag,
- newFieldValues:
String[]
- the new value array to set.
Return
int
:1
: success
Exception
- Exception
Documentation
- Update a Contact by ID.
Examples
public void updateContactSample() throws java.lang.Exception {
Puresend p = new Puresend();
PuresendPortType ppt = p.getPuresendHttpsSoap12Endpoint();
String username = "XXX";
String password = "XXX";
long contactId = 123456789L;
String[] newFieldValues = new String[]{"field1", "field2"};
int result = ppt.updateContact(username,
password,
contactId,
false,
false,
true,
newFieldValues);
}
<?php
include 'puresend.php';
$p = new Puresend();
$updateContactData = new updateContact();
$updateContactData->username = 'XXX';
$updateContactData->password = 'XXX';
$updateContactData->contactId = 123456789;
$updateContactData->optOut = false;
$updateContactData->emailBounced = false;
$updateContactData->clearField = true;
$updateContactData->newFieldValues = array('field1', 'field2');
$response = $p->updateContact($updateContactData);
var_dump($response);
?>