Skype for Business - contactPresence Resource

contactPresence

  • JSON
  • XML

Represents a contact's availability and activity.

Web link

For more on web links, see Web Links.

Name Description
relThe resource that this link points to. In JSON, this is the outer container.
hrefThe location of this resource on the server, and the target of an HTTP operation.

Resource description

contactPresence is updated when a contact's availability or activity changes.

Properties

Name Description
activity The contact's current activity encoded in UTF-16 and in the locale specified during application creation.

The value of this string is localized in the current application's culture provided the localized string exists in the contact's publication. Otherwise, the value of this string is one of the well known activity strings in which case the application is responsible for the localization. The well known ones are "in-a-meeting", "urgent-interruptions-only", "on-the-phone", "in-a-conference", "off-work", and "presenting".

availability The contact's availability (Availability), such as Away or Busy.
deviceType The type of device (ContactDeviceType) that the contact is currently using.
lastActive The last date and time the contact used her device. In JSON, this is represented as POSIX time. In XML, as ISO 8601.

Links

This resource can have the following relationships.

Link Description
selfThe link to the current resource.

Events

  • updated
Resource Priority Sender Reason
contactPresenceMediumpeople Indicates the contact's presence has changed. The application may decide to fetch the updated information.

Sample of returned event data.

This sample is given only as an illustration of event syntax. The semantic content is not guaranteed to correspond to a valid scenario.

{
  "_links" : {
    "self" : {
      "href" : "http://sample:80/ucwa/v1/applications/appId/events?ack=98"
    },
    "next" : {
      "href" : "http://sample:80/ucwa/v1/applications/appId/events?ack=98"
    }
  },
  "sender" : [
    {
      "rel" : "people",
      "href" : "https://fe1.contoso.com:443//v1/applications/970/people",
      "events" : [
        {
          "link" : {
            "rel" : "contactPresence",
            "href" : "https://fe1.contoso.com:443//v1/applications/970/people/235/contactPresence"
          },
          "in" : {
            "rel" : "contact",
            "href" : "https://fe1.contoso.com:443//v1/applications/970/people/235"
          },
          "type" : "updated"
        }
      ]
    }
  ]
}

Operations

  • GET

Returns a representation of a contact's presence.

Request body

None

Response body

The response from a GET request contains the properties and links shown in the Properties and Links sections at the top of this page.

Synchronous errors

The errors below (if any) are specific to this resource. Generic errors that can apply to any resource are covered in Generic synchronous errors.

Error Code Subcode Description
Forbidden403None The user does not have sufficient privileges to access the contact list.
ServiceFailure500InvalidExchangeServerVersion
Conflict409AlreadyExists
Conflict409TooManyGroups
Conflict409None

Examples

Request

Get https://fe1.contoso.com:443//v1/applications/970/people/235/contactPresence HTTP/1.1
Authorization: Bearer cwt=PHNhbWw6QXNzZXJ0aW9uIHhtbG5...uZm8
Host: fe1.contoso.com
Accept: application/json

  

JSON Response

This sample is given only as an illustration of response syntax. The semantic content is not guaranteed to correspond to a valid scenario.

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 217
{
  "rel" : "contactPresence",
  "activity" : "in-a-conference",
  "availability" : "Online",
  "deviceType" : "Mobile",
  "lastActive" : "\/Date(1430220844370)\/",
  "_links" : {
    "self" : {
      "href" : "//v1/applications/970/people/235/contactPresence"
    }
  }
}
  

Request

Get https://fe1.contoso.com:443//v1/applications/970/people/235/contactPresence HTTP/1.1
Authorization: Bearer cwt=PHNhbWw6QXNzZXJ0aW9uIHhtbG5...uZm8
Host: fe1.contoso.com
Accept: application/xml

  

XML Response

This sample is given only as an illustration of response syntax. The semantic content is not guaranteed to correspond to a valid scenario.

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 454
<?xml version="1.0" encoding="utf-8"?>
<resource rel="contactPresence" href="//v1/applications/970/people/235/contactPresence" xmlns="http://schemas.microsoft.com/rtc/2012/03/ucwa">
  <property name="rel">contactPresence</property>
  <property name="activity">in-a-conference</property>
  <property name="availability">Online</property>
  <property name="deviceType">Mobile</property>
  <property name="lastActive">2015-04-28T04:34:04.3709635-07:00</property>
</resource>