Skype Web SDK object model

Applies to: Skype for Business 2015

In this article
Model layer
Application object
Person list
Conversations
MePerson object

The object model is shown in the following figure (Figure 1). Use the Application constructor and the new keyword to create an Application object of the Skype.Web.Model**.Application** type. Application is the only object with a constructor. All other objects are obtained according to figure below.

Figure 1. Object Model

Skype Web SDK Object Model

Model layer

The foundation of the SDK is the Application model object. It is an object that includes other model objects as members (i.e. signInManager or personsAndGroupsManager), collections, properties and commands/methods. This section briefly describes the nature of these API types. See an in-depth description in the Property Model section.

  • Model objects. These are plain JS objects that are called "model objects" because their members are of the four types: other model objects, observable properties, observable collections and observable commands.
  • Properties. These objects are actually functions that keep the current value and provide certain API to deal with that value. The property objects are somewhat similar to the Knockout's observables.
  • Collections. They resemble the property objects in many ways, but deal with arrays of values. Internally, a collection is a pair of arrays: values and keys for those values.
  • Commands. These are just functions with a boolean observable property called enabled that tells if the function can be invoked at the moment. Many commands in the SDK interface are asynchronous and return a promise object.
  • Promise. This is the Promise/A+ object that is well described elsewhere. In short, it's a object that represents a pending asynchronous operation and allows to set callbacks to be invoked once the operation is completed: p.then(onSuccess, onFailure).

Application is the only constructor accessible to the app. Internally in the SDK every model object has a constructor, but an app wouldn't be able to invoke it even if it was accessible because those internal constructors need references to many internal objects, such as the "UCWA stack" object or the "contact cache".

The SDK allows to create multiple instance of Application and potentially different instances may sign in with different user identities and connect to different UCWA servers. For instance:

app1 = new Application;
app2 = new Application;

app1.signIn({
  username: "johndoe@contoso.com",
  password: "***********"
});

app2.signIn({
  username: "joesmith@abc.com",
  password: "********"
});

Application object

The Application object is created by calling the application constructor and is the entry point to the API. Use the Application#signinManager to get state change events and signed-in user presence. All operations in the SDK depend on the Application object and require that a user is signed in through this object. This object encapsulates a REST communication stack for the signed in user. The functions of this object include:

  • Sign a user in using OAUTH, NTLM, or basic authentication with Application.SignInManager

  • Sign a user out with SignInManager by using the Application#signInManager member.

  • Get the current sign in state of the user.

  • Get a reference to the user's person list by reading the Application#personAndGroups member. The member references a PersonAndGroupsManager object.

  • Get a reference to the conversations that the user has joined by reading the Application#conversationsManager member. The member references a ConversationsManager object.

  • Get a reference to the available media devices by reading the Application#devicesManager member. The member references a DevicesManager object.

Person list

Access the signed in user's person list by getting a Group object on Application#personsAndGroupsManager.all:

The .mePerson members provides a reference to the MePerson object through PersonAndGroupsManager.mePerson.

The .persons collection contains all of the persons in the person list across all user defined and server defined groups. Contacts in the distribution groups are not in this collection. Use the .persons collection to get a Person out of the list. This collection is empty unless the application subscribes to it by calling .subscribe or fetches the list once with .get.

The .groups collection encapsulate the person groups that appear in the user's person list. Use the .groups collection to get sets of person groups based on:

  • Privacy relationship to user

  • Server defined groups

  • User defined groups

Conversations

Access the conversations that the user is participating in by reading the Application#conversationsManager.conversations collection. If you register a callback for the .added event on the conversation collection, your application can accept incoming conversation invitations.

MePerson object

The signed in user is encapsulated by the MePerson object obtained from the PersonAndGroupsManager#mePerson property. The MePerson object lets you read and write the following user properties:

  • User's current location

  • Users personal note

  • User presence availability

The following MePerson properties are read-only:

  • SIP URI

  • User Display Name

  • User presence activity

  • Work title

  • Work department

  • Primary work email

  • Other email addresses

  • User photograph URL

See also

Retrieve the API entry point and sign in a user
Show a person's information
Search for persons and distribution groups
Respond to a conversation invitation