Pages Menu

Posted by on May 8, 2015 in Learn Skype Web SDK | 0 comments

Learn Skype Web SDK Day 7 : Setting Your Own Presence

Learn Skype Web SDK Day 7 : Setting Your Own Presence

This is one post in a series of more than 30, devoted to helping you get up to speed quickly with the new Skype Web SDK. Each lesson comes with source code (in GitHub) and a working demo page so you can see what it does. Check out the full list of posts on the Skype Web SDK page.

View Demo

We know how to get our own presence, but what about setting it? It’s easy!

We can use the same mePerson object that we used to get presence, by passing the new presence state to the state() method, shown in this example where we set the presence to Do Not Disturb:

[code language=”javascript”]

var client;



Valid presence states you can pass are (and must be typed exactly):

  • Online
  • Busy
  • DoNotDisturb
  • BeRightBack
  • Away
  • OffWork*

*The OffWork state is a slightly odd one because although you can set it, you never see it coming back as a presence state. When you set it, what you see is a presence state of Away, and an activity status of off-work.

In the example I’ve expanded the code from the Get Presence example, and added a drop-down box to allow the setting of presence:

[code language=”javascript”]


Demo Online

You can try this code out against your own Skype for Business environment by going to the demo page. From here you can also download the code from GitHub if you want to host it locally, or take it and use it in your next project.

Disclaimer: This is sample code, intended to inform and educate. It is not production-ready and is lacking key components such as error handling. You use it entirely at your own risk. You should fully understand the effects, limitations and risks of the code before executing, and understand the implications of any set-up steps. By using these code examples you are using the Skype Web SDK, so you should read the Skype Software License Terms to which you are agreeing.

Good to Know

Post a Reply

Your email address will not be published. Required fields are marked *

This site uses cookies to help make this website better. By continuing to use this site we’ll assume you’re OK with that (implied consent).