【问题标题】:Can't create Notes in Contacts exchange无法在通讯录交换中创建笔记
【发布时间】:2018-08-16 13:28:26
【问题描述】:

我正在尝试创建一个包含 Notes 的联系人,但创建了联系人但我无法恢复联系人内部的 Notes。

字典键是:“PersonalNotes”。 使用以下肥皂消息时,我收到用户的 API HttpError 500 错误。 当我更改下面的肥皂消息(如(“你好”)时,我的联系人被创建,但我看不到联系人中的备注部分。更改 RequestServerVersion 后我也尝试过。 更改soap消息中的位置后,我也尝试过。

<soap:Envelope
                    <t:Notes>
                        <t:Entry Key="Notes">**With Notes**</t:Entry>
                    </t:Notes>
                </t:Contact>
    </soap:Body>
</soap:Envelope>

这是我用来创建联系人备注的肥皂消息。

response = self.client.post_retry(url='https://outlook.office365.com/EWS/Exchange.asmx', data=RestoreContact_SOAP, anchormailbox=True, content_type = 'xml')

请帮忙。

【问题讨论】:

    标签: python exchangewebservices contacts


    【解决方案1】:

    注释只是 Item 的主体,因此要创建它们,请使用 body 属性,例如这应该可以工作

      <soap:Body>
        <CreateItem
            xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <SavedItemFolderId>
                <t:FolderId Id="AQMkADczNDE4YWEAMC03ZWZiLTQyM2QtODA1Yi02MmIyNmJkYWMyNmQALgAAA74c3T2WBidIkPPeS33fvkkBAHUQR/0Y6jBNnUCxQousINAAAAIBDgAAAA=="/>
            </SavedItemFolderId>
            <Items
                xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
                <t:Contact
                    xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
                    <FileAs>With Notes</FileAs>
                    <DisplayName>With Notes</DisplayName>
                    <GivenName>With Notes</GivenName>
                    <Initials></Initials>
                    <MiddleName></MiddleName>
                    <Nickname></Nickname>
                    <CompanyName></CompanyName>
                    <t:PhysicalAddresses>
                        <t:Entry Key="Business">
                            <t:Street></t:Street>
                            <t:City></t:City>
                            <t:State></t:State>
                            <t:CountryOrRegion></t:CountryOrRegion>
                            <t:PostalCode></t:PostalCode>
                        </t:Entry>
                        <t:Entry Key="Home">
                            <t:Street></t:Street>
                            <t:City></t:City>
                            <t:State></t:State>
                            <t:CountryOrRegion></t:CountryOrRegion>
                            <t:PostalCode></t:PostalCode>
                        </t:Entry>
                    </t:PhysicalAddresses>
                    <AssistantName></AssistantName>
                    <BusinessHomePage></BusinessHomePage>
                    <Department></Department>
                    <Generation></Generation>
                    <JobTitle></JobTitle>
                    <Manager></Manager>
                    <OfficeLocation></OfficeLocation>
                    <Profession></Profession>
                    <Surname></Surname>
                 <t:Body BodyType="Text">This is the Notes.</t:Body>
                </t:Contact>
            </Items>
        </CreateItem>
    </soap:Body>
    

    【讨论】:

    • ews restore api 如果我尝试在便笺中发送 unicode 数据,则会引发 500 http 错误。有什么具体原因吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-13
    • 2020-11-04
    • 2018-10-15
    • 1970-01-01
    相关资源
    最近更新 更多