Contacts
Create, update, delete, and query from contacts table
Table Specific Information
Select
The add-in uses the Freshdesk API to process WHERE clause conditions built with the following columns and operators. Most of the columns support-server side filtering with the following operators: =,>,<,<=,>=,AND,OR. The rest of the filter is executed client-side within the add-in.
For example, the following query is processed server-side:
SELECT * FROM Contacts WHERE Active = false AND (Email = '[email protected]' OR CompanyId = 1)
The API allows only a subset of columns to be used as filter criteria in the WHERE clause. The following columns can be used:
- Id
- Active
- CompanyId
- Language
- Tag
- TimeZone
- CreatedAt
- UpdatedAt
Note: To filter all contacts created on a specific day (e.g: 2019-09-23), query should be structured as:
WHERE CreatedAt >= '2019-09-22' AND CreatedAt <= '2019-09-24'
Additional Filtering
You can use the SearchEmail column to search by secondary or alternate emails. When included in a query, the value provided is returned in the results for clarity. If no search term is specified, the column is empty.
For example:
SELECT * FROM Contacts WHERE SearchEmail='@outlook.com'
Do not combine Email and SearchEmail in the same WHERE clause.
Insert
Name and Email are mandatory for creating a new contact. The following is an example of creating a new contact:
INSERT INTO Contacts (Name, Email, Language) VALUES ('Example', '[email protected]', 'English')
Update
The following is an example of how to update a contact:
UPDATE Contacts SET Active = true WHERE Id = 786
Delete
The following is an example of how to delete a contact:
DELETE FROM Contacts WHERE Id = 786
Columns
| Name | Type | ReadOnly | Description |
| Active | Boolean | False |
True if contact has been verified. |
| Address | String | False |
Address of the contact. |
| CompanyId | Bigint | False |
Id of primary company of the contact. |
| CreatedAt | Datetime | True |
Contact creation timestamp. |
| Deleted | Boolean | False |
True if the contact has been deleted. |
| Description | String | False |
A short description of the contact. |
| String | False |
Email of the contact. | |
| Id [KEY] | Bigint | False |
ID of the contact. |
| JobTitle | String | False |
Job title of the contact. |
| Language | String | False |
Language of the contact. |
| Name | String | False |
Name of the contact. |
| OtherEmailsAggregate | String | False |
Additional emails associated with the contact. |
| Phone | String | False |
Telephone number of the contact. |
| Mobile | String | False |
Mobile number of the contact. |
| TimeZone | String | False |
Time zone of the contact. |
| Tag | String | False |
Tag associated with the contact. |
| UpdatedAt | Datetime | True |
Contact updated timestamp. |
| ViewAllTickets | Boolean | False |
True if the contact can see all tickets that are associated with the company to which he belong. |
| State | String | False |
State of the contact. |
| SearchEmail | String | False |
Column used to search by primary or secondary emails. Returns the search term when used in a query (empty otherwise). Do not combine with Email in the same filter. |