listAddContactsForm
public static integer listAddContactsForm(string token, string signupFormID, array contacts)
dd the contact details to the given contact list using an existing signup form.
Parameters
|
string token | A valid token for your account. To generate a token, use the login method. |
string signupFormID | The ID of the signup form you want to use. To get all the signup forms, use the listGetSignupForms method. |
array contacts | The array containing the contact details.string email | The email address | string firstname | The First Name of the contact | string lastname | The Last Name of the contact |
|
Returns |
integer | Returns the total number of contacts which were successfully added. |
- <?php
- /**
- This Example shows how to authenticate a user using XML-RPC.
- Note that we are using the PEAR XML-RPC client and recommend others do as well.
- **/
- require_once 'XML/RPC2/Client.php';
- require_once 'inc/config.php';
- $client = XML_RPC2_Client::create($apiURL);
- $token = $client->login($apiLogin, $apiPassword);
-
- /**
- Fetch the latest signup form, so we can retrieve the signup form ID.
- **/
- $formList = $client->listGetSignupForms($token, 1, 1, "");
- $formID = $formList[0]['id'];
- Prepare the data to insert.
- **/
- $record1['email'] = "user1@___.com";
- $record1['firstname'] = 'Peter';
- $record1['lastname'] = 'Parker';
- $added = $client->listAddContactsForm($token, $formID, $record1);
-
- echo $added . " records added.";
- ?>