A contact is someone relevant to the Wix user’s business – either a site visitor who has performed a meaningful interaction within the site, or a person who was added directly by the user.
Users can manage their contacts from the Wix Dashboard – they can add, view, or delete contacts, including the contacts your app will create.
With the WixHive, you can get information about contacts and also share information your app collects – like a contact’s name, email, address, etc. (see the Contact Schema for all properties):
Important: If your app collects contact information when site visitors perform actions on the site (like purchases or reservations), don’t use the methods shown below. Instead, post the activity – we’ll create the contact while also linking the contact to its activity on the site.
When you have information about a contact, there are three ways to share it with the WixHive – choose the one that best describes your use case:
Once you share the information, the contact is immediately created/updated, and users can see it in the Contacts section of the Wix Dashboard (it may take a few seconds to update).
This is the most common way to add information about a contact. You simply report the data your app collected, making sure to include at least one of these details – the contact’s email or phone number.
We’ll check if the contact already exists – if it does, we’ll update it. If not, we’ll create a new contact.
When to use it:
Here’s how:
Share all the information you have about the contact using the Wix.Contacts.reconcileContact SDK method or the POST /Contacts (version=2.0.0) HTTP API endpoint.
Remember to include the email or phone number in your request – we need it to create/update the contact.
Once posted, we’ll check if the contact already exists and immediately send you a response with this information:
** Note:** If we find more than one contact that matches the information you sent, we’ll return the contact that was created first.
JS SDK
HTTP API
When you already have the Contact ID, you can add a value to a specific property – as long as its data type is an array: email, phone, address, URL, and date. See the Contact Schema for a list of all properties and their data type.
What if the property’s data type isn’t an array? In that case, just report the information you have about the contact.
How to add a value to a specific property:
Use any one of the POST /Contacts/{ContactId}/* HTTP API endpoints (for example: POST /Contacts/{ContactId}/address).
Once posted, we’ll add the new information to the contact.
You can override data as long as the Wix user approves the change – so make sure your UI includes the option for the user to select the correct data.
Here’s an example: The Wix user updated a contact’s name using your app. Your app reports this change – but since the contact already has a name, your data is rejected. All is not lost, though – just prompt the user to approve the change, and then override existing data with newer information from your app.
To use this method, you need:
How to override information:
Once the user approves, you can update the value for a specific property – use any one of the PUT /Contacts/{ContactId}/* HTTP API endpoints.
There are three ways for your app to get information about contacts – it all depends on what you need:
If you have the Contact ID, your app can get information about a specific contact – use the GET /Contacts/{ContactID} HTTP API endpoint or the Wix.Contacts.getContactById SDK method.
Note: Don’t have the Contact ID? There might be another way to get the information you need: If you have the contact’s email, phone, first or last name, you can get a list of all contacts in the site, and then filter the response to get details for this contact only.
JS SDK
HTTP API
Your app can get a list of all contacts in a site, including their information – use the Wix.Contacts.getContacts SDK method or the GET /contacts HTTP API endpoint.
In the response, we send all the information we have for each contact in the site. If you’re using the HTTP API endpoint, you can specify what we send in the response:
JS SDK
HTTP API
You can sign up in your app’s page in the Dev Center to receive immediate notifications. These events will be delivered to your app via webhooks and will include the Contact ID.
Name | Type | Description |
---|---|---|
id | String | Contact's ID |
name | Object | Contact's name |
name.prefix | String | Name prefix |
name.first | String | First name |
name.middle | String | Middle name |
name.last | String | Last name |
name.suffix | String | Name suffix |
picture | String | URL of the contact's photo |
company | Object | Contact's company details |
company.role | String | Contact's role in the company |
company.name | String | Contact's company name |
emails | Array[Objects] | Contact's email addresses |
emails.id | Number | ID of this email within the array |
emails.tag | String | Tag for this email - home, work, etc |
emails.email | String | Email address |
emails.emailStatus | ‘optOut’, ‘transactional’, ‘recurring’ | The subscription status of the current email |
emails.deliveryStatus | ‘valid’, ‘spam’, ‘complaint’, ‘rejected’, ‘deferral’, ‘bounce’ | Email delivery status:* valid: When emails are delivered successfully. * spam: When emails are marked as spam by the recipient. * complaint: When the recipient of the email has made a complaint to the email provider. * rejected: When the email is rejected by email provider. * deferral: When your email provider refuses to send emails. * bounce: When the mailbox is full, email address doesn't exist, etc. |
phones | Array[Objects] | Contact's phone numbers |
phones.id | Number | ID of this phone number within the array |
phones.tag | String | Tag for this phone number - home, work, etc |
phones.phone | String | Phone number |
phones.normalizedPhone | String | Normalized phone number |
addresses | Array[Objects] | Contact's addresses |
addresses.id | Number | ID of this address within the array |
addresses.tag | String | Tag for this address - home, work, etc |
addresses.address | String | Street address |
addresses.neighborhood | String | Neighborhood |
addresses.city | String | City |
addresses.region | String | Region, like a U.S state or a province in Canada |
addresses.country | String | Country |
addresses.postalCode | String | Postal code |
urls | Array[Objects] | URLs associated with the contact, like Facebook or LinkedIn |
urls.id | Number | ID of this URL within the array |
urls.tag | String | Tag for this URL - personal, work, etc |
urls.url | String | The URL |
dates | Array[Objects] | Important dates for this Contact, like birthday |
dates.id | Number | ID of this date within the array |
dates.tag | String | Tag for this date - birthday, anniversary, etc |
dates.date | Datetime | The date, as an ISO 8601 timestamp |
createdAt | Date | The date this contact was created, as an ISO 8601 timestamp |
links | Array[Objects] | An array of HATEOAS links to operations applicable to the Contact resource |
links.href | String | The href of the operation relevant to this resource |
links.rel | String | The relationship of this operation to the returned resource |
modifiedAt | Timestamp | Date and time this contact was modified, as an ISO 8601 timestamp |