Skype for Business - presenceSubscription Resource

presenceSubscription

  • JSON
  • XML

Represents the subscription to a user-defined set of contacts.

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

This resource allows the application to keep track of members of the subscription. Updates include presence, location, or note changes for a specific contact. Additionally, an update on the event channel will inform the application that the subscription is about to expire. The application can then elect to refresh the subscription. Unlike group, presenceSubscription is not persistent and is typically relevant only for a short duration.

Properties

Name Description
id The ID for this presence subscription. The ID is unique for this application.

Links

This resource can have the following relationships.

Link Description
selfThe link to the current resource.
addToPresenceSubscription Represents the capability to add contacts to a presenceSubscription.
memberships The memberships resource.

Events

  • added
  • updated
  • deleted
Resource Priority Sender Reason
presenceSubscriptionMediumpeople Delivered when the presence subscription resource is added.

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=16"
    },
    "next" : {
      "href" : "http://sample:80/ucwa/v1/applications/appId/events?ack=26"
    }
  },
  "sender" : [
    {
      "rel" : "people",
      "href" : "https://fe1.contoso.com:443//v1/applications/970/people",
      "events" : [
        {
          "link" : {
            "rel" : "presenceSubscription",
            "href" : "https://fe1.contoso.com:443//v1/applications/970/presenceSubscription"
          },
          "type" : "added"
        }
      ]
    }
  ]
}
Resource Priority Sender Reason
presenceSubscriptionMediumpeople Delivered when the presence subscription resource is updated.

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=48"
    },
    "next" : {
      "href" : "http://sample:80/ucwa/v1/applications/appId/events?ack=48"
    }
  },
  "sender" : [
    {
      "rel" : "people",
      "href" : "https://fe1.contoso.com:443//v1/applications/970/people",
      "events" : [
        {
          "link" : {
            "rel" : "presenceSubscription",
            "href" : "https://fe1.contoso.com:443//v1/applications/970/presenceSubscription"
          },
          "type" : "updated"
        }
      ]
    }
  ]
}
Resource Priority Sender Reason
presenceSubscriptionMediumpeople Delivered when the presence subscription resource is deleted.

Sample of returned event data.

{
  "_links" : {
    "self" : {
      "href" : "http://sample:80/ucwa/v1/applications/appId/events?ack=72"
    },
    "next" : {
      "href" : "http://sample:80/ucwa/v1/applications/appId/events?ack=72"
    }
  },
  "sender" : [
    {
      "rel" : "people",
      "href" : "https://fe1.contoso.com:443//v1/applications/970/people",
      "events" : [
        {
          "link" : {
            "rel" : "presenceSubscription",
            "href" : "https://fe1.contoso.com:443//v1/applications/970/presenceSubscription"
          },
          "type" : "deleted"
        }
      ]
    }
  ]
}

Operations

  • GET
  • POST
  • DELETE

Returns a representation of the subscription to a user-defined set of contacts.

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 or modify a presence subscription that was created by the system.
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/presenceSubscription 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: 299
{
  "rel" : "presenceSubscription",
  "id" : "3",
  "_links" : {
    "self" : {
      "href" : "//v1/applications/970/presenceSubscription"
    },
    "addToPresenceSubscription" : {
      "href" : "//v1/applications/970/presenceSubscription/addToPresenceSubscription"
    },
    "memberships" : {
      "href" : "//v1/applications/970/presenceSubscription/memberships"
    }
  }
}
  

Request

Get https://fe1.contoso.com:443//v1/applications/970/presenceSubscription 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: 478
<?xml version="1.0" encoding="utf-8"?>
<resource rel="presenceSubscription" href="//v1/applications/970/presenceSubscription" xmlns="http://schemas.microsoft.com/rtc/2012/03/ucwa">
  <link rel="addToPresenceSubscription" href="//v1/applications/970/presenceSubscription/addToPresenceSubscription" />
  <link rel="memberships" href="//v1/applications/970/presenceSubscription/memberships" />
  <property name="rel">presenceSubscription</property>
  <property name="id">3</property>
</resource>
  

Extends an existing subscription to a user-defined set of contacts.

Query parameters

Click here to see the input values.

Name Description Required?
duration The desired length of the subscription in minutes.

If this is a new subscription, the length will be used. If it is an existing subscription, the length will be added to the remaining duration. If this sum is greater than 30 minutes, 30 minutes will be used.

The maximum value is 30 and the minimum value is 10.

Yes

Request body

Click here to see the input values.

Name Description Required?
duration The desired length of the subscription in minutes.

If this is a new subscription, the length will be used. If it is an existing subscription, the length will be added to the remaining duration. If this sum is greater than 30 minutes, 30 minutes will be used.

The maximum value is 30 and the minimum value is 10.

Yes

Response body

Item Description
presenceSubscription Represents the subscription to a user-defined set of contacts.

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 or modify a presence subscription that was created by the system.
Forbidden403None The user does not have sufficient privileges to modify the contact list.
Conflict409None Conflict occurs when the resource is not in the proper state to accept the request.
ServiceFailure500CallbackChannelError
Conflict409AlreadyExists
Conflict409TooManyGroups
Conflict409None

Examples

Only server-supplied query parameters, if any, are shown in the request sample.

Request

Post https://fe1.contoso.com:443//v1/applications/970/presenceSubscription 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 201 Created
Content-Type: application/json
Content-Length: 299
{
  "rel" : "presenceSubscription",
  "id" : "3",
  "_links" : {
    "self" : {
      "href" : "//v1/applications/970/presenceSubscription"
    },
    "addToPresenceSubscription" : {
      "href" : "//v1/applications/970/presenceSubscription/addToPresenceSubscription"
    },
    "memberships" : {
      "href" : "//v1/applications/970/presenceSubscription/memberships"
    }
  }
}
  

Request

Post https://fe1.contoso.com:443//v1/applications/970/presenceSubscription 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 201 Created
Content-Type: application/xml
Content-Length: 478
<?xml version="1.0" encoding="utf-8"?>
<resource rel="presenceSubscription" href="//v1/applications/970/presenceSubscription" xmlns="http://schemas.microsoft.com/rtc/2012/03/ucwa">
  <link rel="addToPresenceSubscription" href="//v1/applications/970/presenceSubscription/addToPresenceSubscription" />
  <link rel="memberships" href="//v1/applications/970/presenceSubscription/memberships" />
  <property name="rel">presenceSubscription</property>
  <property name="id">3</property>
</resource>
  

Deletes an existing subscription to a user-defined set of contacts.

Request body

None

Response body

None

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 or modify a presence subscription that was created by the system.

Examples

Request

Delete https://fe1.contoso.com:443//v1/applications/970/presenceSubscription HTTP/1.1
Authorization: Bearer cwt=PHNhbWw6QXNzZXJ0aW9uIHhtbG5...uZm8
Host: fe1.contoso.com

  

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 204 No Content

  

Request

Delete https://fe1.contoso.com:443//v1/applications/970/presenceSubscription HTTP/1.1
Authorization: Bearer cwt=PHNhbWw6QXNzZXJ0aW9uIHhtbG5...uZm8
Host: fe1.contoso.com

  

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 204 No Content