Zoho 的 API 要求您发布 XML 数据。
下面是一个使用httparty
gem 的例子:
require 'httparty'
class ZohoCRM
include HTTParty
end
# Generated rom Zoho API
AUTH_TOKEN = '1234567890ABCDEF'
# The contact (lead, etc.) record Id
entity_id = '1234567000000012345'
api_context = 'crmapi'
xml_data = "<Notes><row no='1'><FL val='entityId'>#{entity_id}</FL><FL val='Note Title'>Zoho CRM Sample Note</FL><FL val='Note Content'>This is sample content to test Zoho CRM API</FL></row></Notes>"
response = ZohoCRM.post(
'https://crm.zoho.com/crm/private/xml/Notes/insertRecords',
body: {
newFormat: '1',
authtoken: AUTH_TOKEN,
scope: api_context,
xmlData: xml_data
}
)
引用:https ://www.zoho.com/crm/help/api/insertrecords.html#Insert_notes_and_relate_to_the_primary_module