查找有关如何使用 AddNewTelUriContactToGroup EWS 操作的信息。
AddNewTelUriContactToGroup 操作根据联系人的电话号码向组添加新联系人。
Exchange Server 2013 中引入了此操作。
使用 AddNewTelUriContactToGroup 操作
AddNewTelUriContactToGroup 操作请求提交联系人的 TEL URI、SIP URI、电话号码以及要向其添加联系人的组。 AddNewTelUriContactToGroup 操作响应为新联系人创建角色。 此操作允许客户端添加新联系人,即使该联系人没有名称。
AddNewTelUriContactToGroup 操作 SOAP 标头
AddNewTelUriContactToGroup 操作可以使用下表中列出的 SOAP 标头。
| 标头名称 | 元素 | 说明 |
|---|---|---|
| 模拟 |
ExchangeImpersonation |
标识客户端应用程序正在模拟的用户。 此标头适用于请求。 |
| MailboxCulture |
MailboxCulture |
标识要用于访问邮箱的区域性,如 RFC 3066“标识语言标记”中所述。 此标头适用于请求。 |
| RequestVersion |
RequestServerVersion |
标识操作请求的架构版本。 此标头适用于请求。 |
| ServerVersion |
ServerVersionInfo |
标识响应请求的服务器版本。 此标头适用于响应。 |
AddNewTelUriContactToGroup 操作请求示例:向组添加新联系人
下面的 AddNewTelUriContactToGroup 操作请求示例演示如何使用联系人的 TEL 和 SIP URI 创建新联系人,并将新联系人添加到即时消息 (IM) 组。
注意
为了保持可读性,本文中的所有项标识符和更改键都已缩短。
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013" />
<t:MailboxCulture>en-US</t:MailboxCulture>
</soap:Header>
<soap:Body >
<m:AddNewTelUriContactToGroup>
<m:TelUriAddress>tel:5625550100</m:TelUriAddress>
<m:ImContactSipUriAddress>sip:john@contoso.com</m:ImContactSipUriAddress>
<m:ImTelephoneNumber>5625550100</m:ImTelephoneNumber>
<m:GroupId Id="AAMkADEzOTm4QrAABY7+0GAAA="/>
</m:AddNewTelUriContactToGroup>
</soap:Body>
</soap:Envelope>
请求 SOAP 正文包含以下元素:
成功的 AddNewTelUriContactToGroup 操作响应
以下示例显示了对 AddNewTelUriContactToGroup 操作请求创建联系人的成功响应。 响应包含联系人的关联角色标识符、角色的显示名称(在本例中基于联系人的电话号码)和联系人的项目标识符(显示为源标识符属性的一部分)。
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<s:Header>
<h:ServerVersionInfo MajorVersion="15"
MinorVersion="0"
MajorBuildNumber="545"
MinorBuildNumber="11"
Version="Exchange2013"
xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns="http://schemas.microsoft.com/exchange/services/2006/types" />
</s:Header>
<s:Body>
<AddNewTelUriContactToGroupResponse ResponseClass="Success"
xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<ResponseCode>NoError</ResponseCode>
<Persona>
<t:PersonaId Id="AAQkADE686dX3s="/>
<t:PersonaType>Person</t:PersonaType>
<t:CreationTime>2012-10-29T23:10:13Z</t:CreationTime>
<t:DisplayName/>
<t:DisplayNameFirstLast>5625550100</t:DisplayNameFirstLast>
<t:DisplayNameLastFirst>5625550100</t:DisplayNameLastFirst>
<t:FileAs/>
<t:FileAsId >None</t:FileAsId>
<t:RelevanceScore >2147483647</t:RelevanceScore>
<t:Attributions>
<t:Attribution>
<t:Id>0</t:Id>
<t:SourceId Id="ABhHuhCAAA=" ChangeKey="EQAAABxFU"/>
<t:DisplayName>Lync Contacts</t:DisplayName>
<t:IsWritable>false</t:IsWritable>
<t:IsQuickContact>true</t:IsQuickContact>
<t:IsHidden>false</t:IsHidden>
</t:Attribution>
</t:Attributions>
<t:FileAsIds>
<t:StringAttributedValue>
<t:Value>None</t:Value>
<t:Attributions>
<t:Attribution>0</t:Attribution>
</t:Attributions>
</t:StringAttributedValue>
</t:FileAsIds>
<t:OtherTelephones>
<t:PhoneNumberAttributedValue>
<t:Value>
<t:Number>5625550100</t:Number>
<t:Type>Other</t:Type>
</t:Value>
<t:Attributions>
<t:Attribution>0</t:Attribution>
</t:Attributions>
</t:PhoneNumberAttributedValue>
</t:OtherTelephones>
</Persona>
</AddNewTelUriContactToGroupResponse>
</s:Body>
</s:Envelope>
响应 SOAP 正文包含以下元素:
AddNewTelUriContactToGroup 操作错误响应示例
以下示例演示当组标识符包含格式正确的值(该值未标识邮箱中的组)时, 对 AddNewTelUriContactToGroup 操作请求的错误响应。
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15"
MinorVersion="0"
MajorBuildNumber="545"
MinorBuildNumber="11"
Version="Exchange2013"
xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<AddNewTelUriContactToGroupResponse ResponseClass="Error"
xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<MessageText>The specified object was not found in the store.</MessageText>
<ResponseCode>ErrorItemNotFound</ResponseCode>
<DescriptiveLinkKey>0</DescriptiveLinkKey>
</AddNewTelUriContactToGroupResponse>
</s:Body>
</s:Envelope>
错误响应 SOAP 正文包含以下元素: