Lync contacts

Lync 2013

Core concepts

Learn about the Microsoft Lync 2013 classes and enumerations that encapsulate all of the attributes of a Lync 2013 contact.

Last modified: April 09, 2013

Applies to: Lync 2013 | Lync Server 2013

A contact is a person who can sign in to Lync 2013 or another public IM connectivity (PIC) client. The modalities with which a Lync 2013 user can communicate with another contact depend on the type of client on which the other contact is signed in. A PIC client such as Windows Live Messenger or the AOL client can communicate with a Lync 2013 client by using the IM modality only.

Note Note

The API entry point for a conversation in the Microsoft Lync 2013 API is the Conversation object. Users or telephone numbers that will be the remote participants in a conversation are always represented by Contact objects. You cannot start a conversation in Lync 2013 without a contact.

GetContactByUri method

In addition to being the SIP URI of a Lync 2013 user, a Contact object can be a telephone number or a Hotmail account. As long as you have a valid SIP, TEL, or mail URI, you can find a Contact object by calling the GetContactByUri method. It is important to understand that the URI that you provide must be resolved to an entity that publishes its presence in order to see the availability of the contact. For example, if you supply a mail URI, the availability of the mail contact will always show as unknown because a mail account cannot communicate in real-time and does not publish presence. A public switch telephone network (PSTN) telephone number represented by a TEL URI is always available to respond to audio calls in real time but does not publish availability including the ability to accept calls.

Finding contacts by using the search feature of the API

If you must use Contact objects that are guaranteed to resolve to entities that publish presence, then use the Lync 2013 search feature to return a set of Contact objects that belong to the local Microsoft Lync Server 2013 topology or a federated topology. Contacts found by the search feature have the full presence publishing capability necessary to get real-time updates of availability, willingness to communicate, and communication capabilities. For information about searching for contacts, see How to: Search for a contact or distribution group in Lync SDK.

The Microsoft.Lync.Model.Contact class and related classes encapsulate the following features.


Features and attributes


The contact.


The kind of contact. A contact is typically a person but can be an automated attendant, a bot, or a hunt group.


Contact availability. Enumerates the ways or "states" in which a contact is available for a conversation. Availability states range from offline through free to have a conversation. Intermediate states include busy and do-not-disturb.


Contact calendar state. Enumerates the scheduled activity states that contacts can add to their Microsoft Outlook calendar. These time and date based calendar states are aggregated with the contact availability states that are published by the contact to present a complete view of the contact’s availability.


Contact conversation mode capabilities. Enumerates the modes in which a contact can participate in a conversation. These capabilities are published by a contact when a capability changes. For example, if a contact is available only through a mobile phone, the collection of contact capabilities does not include a capability enumerated by CaptureInstantMessage or RenderInstantMessage.


Contact endpoints. Represents a device on which a contact can be available. These devices include telephone numbers and the Lync client. For example, the collection of a contact’s endpoints can include a mobile phone number that is enumerated by MobilePhone.


Contact information change notification. As a contact signs in and out of an endpoint, goes into or out of a meeting, updates a contact card detail, or other activity, these activities are published to any person who has subscribed to such publications. Contact subscription is handled on the Lync client or on your custom application. These publication events are presented in your application as ContactInformationChanged events. ContactInformationChangedEventArgs exposes a property that returns a collection of ContactInformationType instances, which is a list of all of the contact information items in the publication that caused the event to be raised on a subscribing client.


Contact information types. Enumerates the kinds of information that a contact can publish at any time.


Client-publishable contact information types. Enumerates the kinds of contact information that can be published from a Microsoft Lync 2013 API-based client. This enumeration of information types is much smaller than the enumeration of information types that can be published from Microsoft Lync Server 2013. The server publishes on behalf of a contact when elements of a contact card are changed in a data source such as Active Directory Domain Services.


Contact list manager. The contact manager lets you manage a user’s contact list as it appears in the Lync 2013 client and your own custom client. Use the contact manager to search for contacts and groups that are not in the contact list, add contacts or a distribution group, rename custom groups, add new custom groups, or remove a custom group. If you have the telephone number or URI of a person, you can use the contact manager to return a Contact instance representing the person.


Local contact settings. These settings effect how a local signed-in user interacts with any contact. The settings are only visible to the local user and do not affect the person represented by the contact. There is one exception to this rule. The AccessLevel setting restricts the contact information that another subscribing contact can see about the local signed-in user. For example, if Jeff Hay signs in to Lync as the local user, he can change a contact setting on the contact that represents Daniel Roth so that Daniel can only see Jeff’s contact card information that is appropriate for a PIC user.


Represents the contact settings that were changed as a result of a contact setting changed event.


Enumerates the contact provider type. This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.


Specifies the type of contact information to be subscribed on a collection of contacts set in the subscription.


Enumerates contact subscription freshness.