Sample Applications

From API Documentation

(Difference between revisions)
Jump to: navigation, search
Line 5: Line 5:
== Sample 1: mailing list signup form ==
== Sample 1: mailing list signup form ==
This application allows a site visitor to add himself or herself to a an agent's contact list, while also adding the new contact to a predefined distribution list. The application consists of two files: an HTML file containing a simple signup form, and a PHP file which processes form submissions and makes the necessary API calls.
This application allows a site visitor to add himself or herself to a an agent's contact list, while also adding the new contact to a predefined distribution list. The application consists of two files: an HTML file containing a simple signup form, and a PHP file which processes form submissions and makes the necessary API calls.
-
<source lang="xhtml1transitional">
+
<source lang="html4strict">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

Revision as of 12:50, 5 October 2012

Below are sample applications built using the API, coded using PHP. These samples demonstrate a variety of common use cases. While we do not cover every possible use of the API here, these samples are meant to be indicative of all API calls.

All examples use the cURL library for handling the HTTP request. There are other methods available in PHP (and other languages, of course), and any method that allows you to send and receive the properly formatted requests and responses is perfectly acceptable.

Sample 1: mailing list signup form

This application allows a site visitor to add himself or herself to a an agent's contact list, while also adding the new contact to a predefined distribution list. The application consists of two files: an HTML file containing a simple signup form, and a PHP file which processes form submissions and makes the necessary API calls.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Rezora API Sample: Add a Contact</title>
  </head>
  <body>
    <h1>Add a Contact</h1>
    <form action="form_processor.php" method="post" name="addcontactform" id="addcontactform">
      <div>
        <label for="name">Name:</label>
        <input type="text" name="name" id="name" value="" />
      </div>
      <div>
        <label for="email">Email address:</label>
        <input type="text" name="email" id="email" value="" />
      </div>
      <div>
        <input type="submit" value="Submit" />
      </div>
    </form>
  </body>
</html>
 
Personal tools