openapi-node
Version:
A Node library to interact with the Wix Hive (RESTful API)
2,684 lines • 37 kB
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Wix openapi-node Class: Contact</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
<link type="text/css" rel="stylesheet" href="styles/site.spacelab.css">
</head>
<body>
<div class="container-fluid">
<div class="navbar navbar-fixed-top ">
<div class="navbar-inner">
<a class="brand" href="index.html">Wix openapi-node</a>
<ul class="nav">
<li class="dropdown">
<a href="modules.list.html" class="dropdown-toggle" data-toggle="dropdown">Modules<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="API.html">Wix/API</a>
</li>
<li>
<a href="connect.html">wix/connect</a>
</li>
<li>
<a href="Connect_.html">Wix/Connect</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Activities.html">Activities</a>
</li>
<li>
<a href="ActivityType.html">ActivityType</a>
</li>
<li>
<a href="APIBuilder.html">APIBuilder</a>
</li>
<li>
<a href="BaseWixAPIObject.html">BaseWixAPIObject</a>
</li>
<li>
<a href="Contact.html">Contact</a>
</li>
<li>
<a href="Contacts.html">Contacts</a>
</li>
<li>
<a href="Insights.html">Insights</a>
</li>
<li>
<a href="Wix.html">Wix</a>
</li>
<li>
<a href="WixActivity.html">WixActivity</a>
</li>
<li>
<a href="WixActivityData.html">WixActivityData</a>
</li>
<li>
<a href="WixAPICaller.html">WixAPICaller</a>
</li>
<li>
<a href="WixPagingData.html">WixPagingData</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="row-fluid">
<div class="span8">
<div id="main">
<h1 class="page-title">Class: Contact</h1>
<section>
<header>
<h2>
Contact
</h2>
</header>
<article>
<div class="container-overview">
<dt>
<h4 class="name" id="Contact"><span class="type-signature"></span>new Contact<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
WixClient.js
</li></ul></dd>
</dl>
</dd>
</div>
<h3 class="subsection-title">Members</h3>
<dl>
<dt>
<h4 class="name" id="Contact"><span class="type-signature"><static> </span>Contact<span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Prototype</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
WixClient.js
</li></ul></dd>
</dl>
</dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<dl>
<dt>
<h4 class="name" id="addActivity"><span class="type-signature"></span>addActivity<span class="signature">(activity)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Adds an Activity to this <a href="Contact.html"><code>Contact</code></a>. Note, the <a href="Contact.html"><code>Contact</code></a> must be saved for the <code>Activity</code> to be persisted</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>activity</code></td>
<td class="type">
<span class="param-type">Activity</span>
</td>
<td class="description last"><p>The Activity to post</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
WixClient.js
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getActivities"><span class="type-signature"></span>getActivities<span class="signature">(cursor, options)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Returns a list of <code>Activity</code> for this contact, based on the filter. By default, all Activities are returned</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>cursor</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The current cursor</p></td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><a href="global.html#GetActivitiesOptions">GetActivitiesOptions</a></span>
</td>
<td class="description last"><p>The Activity to post</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
WixClient.js
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="toJson"><span class="type-signature"></span>toJson<span class="signature">()</span><span class="type-signature"> → {Object}</span></h4>
</dt>
<dd>
<div class="description">
<p>Creates a JSON Object representing the contact</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
WixClient.js
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>A Json object representing the Contact</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="update"><span class="type-signature"></span>update<span class="signature">(contact)</span><span class="type-signature"> → {Promise.<Object, error>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Checks for the existence of a Contact by either phone, email or both properties.
If the Contact exists with the values you have specified, it will be returned.
If email and phone are specified, a Contact will only be returned if both properties match.
If no match is found, a new Contact will be created</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>contact</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"><p>JSON representing the Contact</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
WixClient.js
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>A new Contact, or an error</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<Object, error></span>
</dd>
</dl>
</dd>
</dl>
<h3 class="subsection-title">Type Definitions</h3>
<dl>
<dt>
<h4 class="name" id="Address">Address</h4>
</dt>
<dd>
<div class="description">
<p>Contact Address information</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>tag</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>The context tag associated with this address,</p></td>
</tr>
<tr>
<td class="name"><code>address</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
<nullable><br>
</td>
<td class="description last"><p>The contact's street address,</p></td>
</tr>
<tr>
<td class="name"><code>neighborhood</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
<nullable><br>
</td>
<td class="description last"><p>The contact's street neighborhood,</p></td>
</tr>
<tr>
<td class="name"><code>city</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
<nullable><br>
</td>
<td class="description last"><p>The contact's city,</p></td>
</tr>
<tr>
<td class="name"><code>region</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
<nullable><br>
</td>
<td class="description last"><p>The contact's region. An example of this would be a state in the US, or a province in Canada,</p></td>
</tr>
<tr>
<td class="name"><code>country</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
<nullable><br>
</td>
<td class="description last"><p>The contact's country,</p></td>
</tr>
<tr>
<td class="name"><code>postalCode</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="attributes">
<nullable><br>
</td>
<td class="description last"><p>The contact's postal code</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
WixClient.js
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="Company">Company</h4>
</dt>
<dd>
<div class="description">
<p>Contact Company information</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>role</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The contact's role within their company,</p></td>
</tr>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The name of the contact's current company</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
WixClient.js
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="CustomField">CustomField</h4>
</dt>
<dd>
<div class="description">
<p>CustomField</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>field</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The name of the custom field</p></td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The value of the custom field</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
WixClient.js
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="Email">Email</h4>
</dt>
<dd>
<div class="description">
<p>Contact Email information</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>tag</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>a context tag</p></td>
</tr>
<tr>
<td class="name"><code>email</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The email address to add</p></td>
</tr>
<tr>
<td class="name"><code>contactSubscriptionStatus</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The subscription status of the current contact ['optIn' or 'optInOut' or 'notSet']</p></td>
</tr>
<tr>
<td class="name"><code>siteOwnerSubscriptionStatus</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The subscription status of the site owner in relation to this contact ['optIn' or 'optInOut' or 'notSet']</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
WixClient.js
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="ID">ID</h4>
</dt>
<dd>
<div class="description">
<p>Contact ID information</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>exists</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>true if this id exists</p></td>
</tr>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The id of this Contact</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
WixClient.js
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="ImportantDate">ImportantDate</h4>
</dt>
<dd>
<div class="description">
<p>Contact Important Date information</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>tag</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The context tag associated with this date</p></td>
</tr>
<tr>
<td class="name"><code>date</code></td>
<td class="type">
<span class="param-type">dateTime</span>
</td>
<td class="description last"><p>An important date for this contact, as an ISO 8601 timestamp</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
WixClient.js
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="Name">Name</h4>
</dt>
<dd>
<div class="description">
<p>Contact Name information</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>prefix</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The prefix of the contact's name</p></td>
</tr>
<tr>
<td class="name"><code>first</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The contact's first name</p></td>
</tr>
<tr>
<td class="name"><code>middle</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The contact's middle name</p></td>
</tr>
<tr>
<td class="name"><code>last</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The contact's last name</p></td>
</tr>
<tr>
<td class="name"><code>suffix</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The suffix of the contact's name</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
WixClient.js
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="Note">Note</h4>
</dt>
<dd>
<div class="description">
<p>Contact Note information</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>tag</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>a context tag</p></td>
</tr>
<tr>
<td class="name"><code>note</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The note to add</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
WixClient.js
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="Phone">Phone</h4>
</dt>
<dd>
<div class="description">
<p>Contact Phone information</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>tag</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>a context tag</p></td>
</tr>
<tr>
<td class="name"><code>phone</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The phone number to add</p></td>
</tr>
<tr>
<td class="name"><code>normalizedPhone</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The contact's normalized phone number</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
WixClient.js
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="StateLink">StateLink</h4>
</dt>
<dd>
<div class="description">
<p>Contact Link information
A HATEOAS link to operations applicable to this Contact resource</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>href</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The href of the operation relevant to this resource</p></td>
</tr>
<tr>
<td class="name"><code>rel</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The relationship of this operation to the returned resource</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
WixClient.js
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="Url">Url</h4>
</dt>
<dd>
<div class="description">
<p>Contact Url information</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>tag</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The context tag associated with this url</p></td>
</tr>
<tr>
<td class="name"><code>url</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>A url associated with this contact</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
WixClient.js
</li></ul></dd>
</dl>
</dd>
</dl>
</article>
</section>
</div>
<div class="clearfix"></div>
<footer>
<a href='http://dev.wix.com'>Wix Developer Center</a>
<br />
<span class="copyright">
2014, Wix
</span>
<br />
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a>
on Thu Jul 31 2014 17:22:21 GMT+0300 (IDT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
</div>
<div class="span3">
<div id="toc"></div>
</div>
<br clear="both">
</div>
</div>
<script src="scripts/sunlight.js"></script>
<script src="scripts/sunlight.javascript.js"></script>
<script src="scripts/sunlight-plugin.doclinks.js"></script>
<script src="scripts/sunlight-plugin.linenumbers.js"></script>
<script src="scripts/sunlight-plugin.menu.js"></script>
<script src="scripts/jquery.min.js"></script>
<script src="scripts/jquery.scrollTo.js"></script>
<script src="scripts/jquery.localScroll.js"></script>
<script src="scripts/bootstrap-dropdown.js"></script>
<script src="scripts/toc.js"></script>
<script> Sunlight.highlightAll({lineNumbers:false, showMenu: true, enableDoclinks :true}); </script>
<script>
$( function () {
$( "#toc" ).toc( {
selectors : "h1,h2,h3,h4",
showAndHide : false,
scrollTo : 60
} );
$( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
} );
</script>
</body>
</html>