Class: Contacts

Contacts

new Contacts()

Source:
  • WixClient.js

Methods

create(contact) → {Promise.<Object, error>}

Creates a new Contact and returns back the ID

Parameters:
Name Type Description
contact object

JSON representing the Contact

Source:
  • WixClient.js
Returns:

A new Contact, or an error

Type
Promise.<Object, error>

getContactById(contactId) → {Promise.<Object, error>}

Returns a Contact by a given ID

Parameters:
Name Type Description
contactId string

The id of the Contact to return

Source:
  • WixClient.js
Returns:

A Contact, or an error

Type
Promise.<Object, error>

getContacts(cursor, options) → {Promise.<WixPagingData, error>}

Returns the Contacts found on the current site

Parameters:
Name Type Description
cursor string

The current cursor

options GetContactsOptions

getContacts query options

Source:
  • WixClient.js
Returns:

A promise for a WixPagingData object to navigate results, or an error

Type
Promise.<WixPagingData, error>

getContactsSubscribers(cursor, options) → {Promise.<WixPagingData, error>}

Returns all the Contacts for the given site that have opted in to receiving communications from applications

Parameters:
Name Type Description
cursor string

The current cursor

options GetContactsSubscribersOptions

getContactsSubscribers query options

Source:
  • WixClient.js
Returns:

A promise for a WixPagingData object to navigate results, or an error

Type
Promise.<WixPagingData, error>

newContact() → {object}

Creates a Contact object

Source:
  • WixClient.js
Returns:

Returns an empty Contact object

Type
object

upsert(phone, email) → {Promise.<Object, error>}

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

Parameters:
Name Type Description
phone String

The contact phone to match with

email String

The contact email to match with

Source:
  • WixClient.js
Returns:

A Contact id, or an error

Type
Promise.<Object, error>