Error with ampersand in XML in Zoho API

前端 未结 1 1183
北荒
北荒 2021-01-21 13:08

I\'m using the Zoho API to insert leads into the CRM.

Everything is working fine except when one of the fields contains an ampersand, in which case the response from Zoh

相关标签:
1条回答
  • 2021-01-21 13:50

    Finally found a solution: strings containing a special characters must be contained in CDATA sections AND those special characters need to be percent encoded.

    So for the example above, this gives:

    <Leads>
        <row no="1">
            <FL val="Lead Owner">me@example.com</FL>
            <FL val="Company"><![CDATA[Marks %26 Spencer]]></FL>
        </row>
    </Leads>
    

    Note that the value Marks%20%26%20Spencer is also OK for the API.

    0 讨论(0)
提交回复
热议问题