Contact extends Model

Summary

The Contact model represents a Contact object served by the Nylas Platform API. For more information about Contacts on the Nylas Platform, read the Contacts API Documentation

Attributes

name: AttributeString The name of the contact. Queryable.

email: AttributeString The email address of the contact. Queryable.

thirdPartyData: AttributeObject Extra data that we find out about a contact. The data is keyed by the 3rd party service that dumped the data there. The value is an object of raw data in the form that the service provides

We also have "normalized" optional data for each contact. This list may grow as the needs of a contact become more complex.

This class also inherits attributes from Model

Instance Methods

toString()

Returns
Return Values

Returns a string of the format Full Name <email@address.com> if the contact has a populated name, just the email address otherwise.

isMe()

Returns
Return Values

Returns true if the contact is the current user, false otherwise. You should use this method instead of comparing the user's email address to the account email, since it is case-insensitive and future-proof.