4

Can anyone please tell me the process of posting the data captured from,a html web form into zoho CRM?

I have created a normal client side html form with all the necessary validations using JavaScript now I want to store the data from that form into zoho CRM so that I can,analyze data better.

user2674961
  • 61
  • 1
  • 5

3 Answers3

2

This is possible to do in javascript. I would suggest using jQuery Ajax method to accomplish this:

http://api.jquery.com/jQuery.post/

You should be able to do something like this:

$.ajax({
  type: "POST",
  url: url,
  data: data,
  success: success,
  dataType: xml
});

where data is the XML document you want to write to zoho. For example to write to the Lead table it would look like:

<Leads>
  <row no="1">
     <FL val="Lead Source">My Lead Source</FL>
     <FL val="Last Name">Smith</FL>
     <FL val="First Name">James</FL>
     <FL val="Email">name@mydomain.com</FL>
     <FL val="Phone">555-1234</FL>
     <FL val="Website">www.mydomain.com</FL>
     <FL val="Description">Some Informative Description</FL>
  </row>
</Leads>

All of this would get posted to

crm.zoho.com/crm/private/xml/Leads/insertRecords along with your auth token and, scope=crmapi and newFormat=1.

More information can be found here: http://www.zoho.com/crm/help/api/insertrecords.html

All that being said, using javascript might not be advisable, as you would have to expose your AUTH key to the world. I don't know for sure, but with this auth key, I would imagine anyone could read, write, or update your Zoho CRM without your knowledge or permission. I'd suggest doing some research on the security implications of doing this in Javascript. I personally haven't ever done it in JS; only in PHP and C#.

James

James Smith
  • 1,072
  • 1
  • 11
  • 14
  • Hi @JamesSmith thank you for this clear answer, are there any recommendations to handle the XML data, should I convert JSON to XML, build the XML string from the fields by concatenation and a for loop? I've never connected to an XML api just JSON so this is pretty weird to me, don't get why ZOHO would use XML. – Diego Ponciano Jun 29 '18 at 17:40
0

Two options: 1) You can submit your form to soho crm - generate a web-form in its setup, and you will see what should be the action and input fields. 2) If you want to do it via AJAX, you cannot do it directly, because of CORS issue. But you can setup your own server-side PHP to push it into ZOHO CRM, using its API (see: https://www.zoho.com/crm/help/api/insertrecords.html) and then interact with it.

0

To submit stuff to Zoho CRM without tokens and APIs. You can do it through Postman. First, You should create a form inside Zoho CRM. Then post that form on a test webpage. Then use postman and postman interceptor to grab the real post data. It should look something like this when it is all done:

Function Pushlead(){
  var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://crm.zoho.com/crm/WebForm",
  "method": "POST",
  "headers": {
    "origin": "https://ad5319be-4b64-4b9e-84ec-42d70d3cbe55.htmlcomponentservice.com",
    "upgrade-insecure-requests": "1",
    "dnt": "1",
    "content-type": "application/x-www-form-urlencoded",
    "user-agent": wixWindow.formFactor,
    "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
    "cache-control": "no-cache",
    "postman-token": "3a7fb37a58"
  },
  "data": {
      "zohoVariableName":"YourVar",
      "etc":"Yours"
  };
}

Postman will give this code. then in the data object you just need to copy/paste the fields that you want to post to crm in normal json format.