Bridge Communications

Saturday, October 10, 2015

Changing your Personal Note in the Lync Client SDK

Skype for Business / Lync has a personal note feature that can be used in a number of different ways.  In a short sentence you can describe who you are, what you are doing, or even where you are for your colleagues and friends to see.

So what if we want to set that programmatically?  What is we want to have a bot user that displays the current temperature in the server room?  The Lync client SDK once again provides an easy way to do this.

Step 1.  Get an instance of your local Lync client.

LyncClient lc;

lc = LyncClient.GetClient();

Step 2.  Use my setLyncNote function below.

private void setLyncNote(string newNote)
                Dictionary<PublishableContactInformationType, object> publishData = new Dictionary<PublishableContactInformationType, object>();

                publishData.Add(PublishableContactInformationType.PersonalNote, newNote);

                object[] asyncState = { lc.Self };

                lc.Self.BeginPublishContactInformation(publishData, null, asyncState);
            { }

Note:  You can see where we add the type of data to the publishData dictionary above.  You can have multiple types of information here.  You can also change the availability and activity id of your user at the same if you wanted.

That will conclude this weeks blog post.  If you have any questions hit me up on twitter.

Doug Routledge, C# Lync, Skype for Business, SQL, Exchange, UC Developer  BridgeOC
Twitter - @droutledge @ndbridge

No comments:

Post a Comment