addContact Request
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
Adds a user to the caller's contact list.
Syntax
<addContact rid="integer value">
<contact></contact>
</addContact>
The following sections describe attributes, parent elements, and child elements.
Attributes
Attribute |
Description |
---|---|
rid |
Represents the client-assigned instance ID of the request. This is a required attribute. |
Element Information
Parent Element
Element |
Description |
---|---|
Contains one or more methods that Unified Communications AJAX API Client sends to a Communicator Web Access Server. |
Child Elements
Element |
Occurrence |
Description |
---|---|---|
1 |
The name, URI, subscription status and tag status of a contact. |
Remarks
This request allows the Unified Communications AJAX API Client application to add a user to their contact list. The contact attribute values must be filled when adding the contact. Failure to do so results in a synchronous requestFailed response from the Communicator Web Access Server.
Along with the requestAccepted response received synchronously on the command channel, the Unified Communications AJAX API Client application receives a contactGroup event and a userPresence event asynchronously on the data channel.
Examples
The following examples demonstrate the two scenarios under which a contact can be added:
- The contact is added to the user's contact list and associated to an existing contact group.
Request
"Jessica Arnold" is being added as a contact to the logged on user's contact list and associated to a contact group.
<addContact rid="17"> <contact uri="sip:jessicaa@contoso.com" name="Jessica Arnold" subscribed="true" tag="True" groups="1"/> </addContact>
Response
Indicates the request was executed successfully. "Jessica Arnold" was added as a contact and associated to group ID "1"
<cwaEvents pollWaitTime="1000" ackId="83" sid="5">
<requestSucceeded eid="82" rid="17" />
<contactGroup eid="83" deltaNum="9">
<contact uri="sip:jessicaa@contoso.com" action="added" name="Jessica Arnold " groups="1" subscribed="true" />
</contactGroup>
</cwaEvents>
- The contact is added to the user's contact list. The new contact is not added to a contact group.
Request
<cwaRequests xmlns="http://schemas.microsoft.com/2006/09/rtc/cwa" sid="6">
<addContact rid="18">
<contact uri="sip:ReshmaP@contoso.com" name="Reshma Patel"/>
</addContact>
</cwaRequests>
Response
The response includes a contactGroup element even though the request did not specify a contact group. You should note that the groups attribute of the contact element does not specify any group IDs. This indicates that the contact was not added to any existing contact groups.
<cwaEvents pollWaitTime="1000" ackId="77" sid="6">
<requestSucceeded eid="76" rid="18" />
<contactGroup eid="77" deltaNum="10">
<contact uri="sip:ReshmaP@contoso.com" action="added" name="Reshma Patel" subscribed="true"/>
</contactGroup>
</cwaEvents>