InsertRecords with jquery erorr
Hi,
I'm trying to call the InsertRecords api with jquery ajax method and I'm getting a 500 internal error message. Does anyone have any suggestions? Here is the code:
- var leadCRMUrl = 'https://crm.zoho.com/crm/private/xml/Leads/insertRecords?'; //api service
- var crmForm = $('#crmForm').serializeArray();
- var crmAcctData = 'newFormat="1"&authtoken=<TOKEN>&scope=crmapi&xmlData='
- crmAcctData +=
- '<?xml version="1.0" encoding="utf-8"?> \
- <Contacts> \
- <row no=1> \
- <FL val="First Name">' + crmForm[0].value + '</FL> \
- <FL val="Last Name">' + crmForm[1].value + '</FL> \
- <FL val="Email">' + crmForm[2].value + '</FL> \
- <FL val="Department">test</FL> \
- <FL val="Phone">9999999999</FL> \
- <FL val="Fax">9999999999</FL> \
- <FL val="Mobile">9999999999</FL> \
- <FL val="Assistant">Test</FL>\
- </row> \
- </Contacts>';
-
- $.ajax({
- type: 'POST',
- url: leadCRMUrl,
- data: crmAcctData,
- dataType: "xml",
- });