AddNewImContactToGroup 操作
AddNewImContactToGroup EWS 操作に関する情報を検索します。
AddNewImContactToGroup 操作は、インスタント メッセージング (IM) グループに新しい連絡先を追加します。
この操作は Exchange Server 2013 で導入されました。
AddNewImContactToGroup 操作の使用
AddNewImContactToGroup 操作は、IM グループに新しい連絡先を追加するために、次の 3 つの引数を受け取ります。
ImAddress プロパティ - 連絡先の IM アドレスを識別します。 このプロパティは必須です。
DisplayName プロパティ - 連絡先の表示名を識別します。
GroupId プロパティ - 連絡先が追加されるグループを識別します。
この操作は、グループに追加された連絡先のペルソナを返します。
AddNewImContactToGroup 操作 SOAP ヘッダー
AddNewImContactToGroup 操作では、次の表に示す SOAP ヘッダーを使用できます。
ヘッダー名 | 要素 | 説明 |
---|---|---|
偽装 |
ExchangeImpersonation |
クライアント アプリケーションが偽装しているユーザーを識別します。 このヘッダーは要求に適用されます。 |
MailboxCulture |
MailboxCulture |
RFC 3066 で定義されている "言語の識別用タグ" で定義されているカルチャを識別し、メールボックスにアクセスするために使用します。 このヘッダーは要求に適用されます。 |
RequestVersion |
RequestServerVersion |
操作要求のスキーマ バージョンを識別します。 このヘッダーは要求に適用されます。 |
ServerVersion |
ServerVersionInfo |
要求に応答したサーバーのバージョンを識別します。 このヘッダーは、応答に適用できます。 |
AddNewImContactToGroup 操作要求の例: 新しい IM 連絡先をグループに追加する
AddNewImContactToGroup 操作要求の次の例は、既存の IM グループに新しい連絡先を追加する方法を示しています。 この例の GroupId プロパティ値は、 AddImGroup 操作の結果から返されました。 ExchangeStoreId プロパティには、GroupId プロパティの値が含まれています。
<?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>
<t:TimeZoneContext>
<t:TimeZoneDefinition Id="GMT Standard Time"/>
</t:TimeZoneContext>
</soap:Header>
<soap:Body >
<m:AddNewImContactToGroup>
<m:ImAddress>tsmith@contoso.com</m:ImAddress>
<m:DisplayName>Tony Smith</m:DisplayName>
<m:GroupId Id="AAMkAGQ1MjJjMTBkLTc4Y2UtNDAAAQKAAA="
ChangeKey="EgAAAA=="/>
</m:AddNewImContactToGroup>
</soap:Body>
</soap:Envelope>
注:
GroupId 値は、読みやすさを維持するために短縮されました。
要求 SOAP 本文には、次の要素が含まれています。
AddNewImContactToGroup 操作の応答が成功しました
次の例は、 AddNewImContactToGroup 操作要求に対する正常な応答を示しています。 応答には、新しく作成された連絡先のペルソナが含まれます。 連絡先は、Exchange の [クイック連絡先] フォルダーに追加されます。
注:
識別子は、読みやすさを維持するために短縮されました。
<?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="349"
MinorBuildNumber="0"
Version="Exchange2013"
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"
xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" />
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<AddNewImContactToGroupResponse ResponseClass="Success"
xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<ResponseCode>NoError</ResponseCode>
<Persona>
<PersonaId Id="AAQkAGQ1MjJjMTBkLTc4Y2UtNDA5Ny04ZjU5LWI3MTYzNGNkZmRkYQAQAJ3EkhEEXN5KufGbSYJanZk="
xmlns="http://schemas.microsoft.com/exchange/services/2006/types" />
<PersonaType xmlns="http://schemas.microsoft.com/exchange/services/2006/types">Person</PersonaType>
<CreationTime xmlns="http://schemas.microsoft.com/exchange/services/2006/types">2012-01-05T23:06:58Z</CreationTime>
<DisplayName xmlns="http://schemas.microsoft.com/exchange/services/2006/types">Tony Smith</DisplayName>
<DisplayNameFirstLast xmlns="http://schemas.microsoft.com/exchange/services/2006/types">Tony Smith</DisplayNameFirstLast>
<DisplayNameLastFirst xmlns="http://schemas.microsoft.com/exchange/services/2006/types">Tony Smith</DisplayNameLastFirst>
<FileAsId xmlns="http://schemas.microsoft.com/exchange/services/2006/types">None</FileAsId>
<EmailAddress xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
<Name>Tony Smith</Name>
<Address>tsmith@contoso.com</Address>
<RoutingType>SMTP</RoutingType>
</EmailAddress>
<EmailAddresses xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
<EmailAddress>
<Name>Tony Smith</Name>
<Address>tsmith@contoso.com</Address>
<RoutingType>SMTP</RoutingType>
</EmailAddress>
</EmailAddresses>
<ImAddress xmlns="http://schemas.microsoft.com/exchange/services/2006/types">tsmith@contoso.com</ImAddress>
<RelevanceScore xmlns="http://schemas.microsoft.com/exchange/services/2006/types">2147483647</RelevanceScore>
<Attributions xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
<Attribution>
<Id>0</Id>
<SourceId Id="BtF8oI7iVOQatt/bhQoTbWAAAAAAvcAAA="
ChangeKey="EQAAABYAAABtF8oIQoTbWAAAAAAyg" />
<DisplayName>Outlook</DisplayName>
<IsWritable>true</IsWritable>
<IsQuickContact>true</IsQuickContact>
<IsHidden>false</IsHidden>
<FolderId Id="AAMkAGQ1MjJjMTBkLTc4YhQoTbWAAAAAAvZAAA="
ChangeKey="AQAAAA==" />
</Attribution>
</Attributions>
<DisplayNames xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
<StringAttributedValue>
<Value>Tony Smith</Value>
<Attributions>
<Attribution>0</Attribution>
</Attributions>
</StringAttributedValue>
</DisplayNames>
<FileAsIds xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
<StringAttributedValue>
<Value>None</Value>
<Attributions>
<Attribution>0</Attribution>
</Attributions>
</StringAttributedValue>
</FileAsIds>
<Emails1 xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
<EmailAddressAttributedValue>
<Value>
<Name>Tony Smith</Name>
<Address>tsmith@contoso.com</Address>
<RoutingType>SMTP</RoutingType>
</Value>
<Attributions>
<Attribution>0</Attribution>
</Attributions>
</EmailAddressAttributedValue>
</Emails1>
<ImAddresses xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
<StringAttributedValue>
<Value>tsmith@contoso.com</Value>
<Attributions>
<Attribution>0</Attribution>
</Attributions>
</StringAttributedValue>
</ImAddresses>
</Persona>
</AddNewImContactToGroupResponse>
</s:Body>
</s:Envelope>
応答 SOAP 本文には、次の要素が含まれています。
AddNewImContactToGroup 操作エラー応答
次の例は、 AddNewImContactToGroup 操作要求に対するエラー応答を示しています。 これは、要求元のメールボックスにないグループに連絡先を追加する要求に対する応答です。
<?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="578"
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">
<AddNewImContactToGroupResponse ResponseClass="Error"
xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<MessageText>No mailbox with such guid.</MessageText>
<ResponseCode>ErrorNonExistentMailbox</ResponseCode>
<DescriptiveLinkKey>0</DescriptiveLinkKey>
<MessageXml>
<t:Value Name="MailboxGuid" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">d5fasdadcw3d-23de-2341-8f59-b71523fsddda</t:Value>
</MessageXml>
</AddNewImContactToGroupResponse>
</s:Body>
</s:Envelope>
エラー応答 SOAP 本文には、次の要素が含まれています。
EWS に汎用であり、この操作に固有のその他のエラー コードについては、「 ResponseCode」を参照してください。