Need Help with ZOHO Creator API ...
Need Help with ZOHO Creator API ...
Hi:
I am trying to test the use of the ZOHO Creator API facilities ... using an HTML document resident on my local disk.
I have obtained my
API Key
and
Ticket
(both of which are replaced in the content below for security reasons)
When I try to make a
XML RPC View Record
request ... as documented here ...
http://api.wiki.zoho.com/XML-RPC---View-Record.html
... I get this reponse ...
<?xml version="1.0" encoding="UTF-8" ?>
- <response>
- <errorlist>
- <error>
<code>
2830
</code>
<message>Content is not allowed in prolog.</message>
</error>
</errorlist>
</response>
... according to the reference, error
283
0 means "
Invalid XML
"
I tried to create the
required XML string
in two ways (both of which return the same error code) ...
a) compose XML string in document's head section ...
<html>
<head>
<script type="text/javascript">
ZCRequest="<ZohoCreator>";
ZCRequest=ZCRequest+"<application name=\"gkLab1\">";
ZCRequest=ZCRequest+"<form name=\"Form4API\">";
ZCRequest=ZCRequest+"<criteria>";
ZCRequest=ZCRequest+"<field name=\"Continent\" compOperator=\"EQUALs\" value=\"Europe\"></field>";
ZCRequest=ZCRequest+"</criteria></form></application></ZohoCreator>";
</script>
</head>
<body>
<form method="POST" action="http://creator.zoho.com/api/xml/read/apikey=abcd&ticket=wxyz">
<input type="hidden" name="XMLString" value=ZCRequest>
<input type="submit" value="Submit XML String">
</form>
</body>
</html>
b) load XML content from an external file ...
<html>
<head>
<script type="text/javascript">
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.load("Form4API Test2.xml");
</script>
</head>
<body>
<form method="POST" action="http://creator.zoho.com/api/xml/read/apikey=abcd&ticket=wxyz">
<input type="hidden" name="XMLString" value=xmlDoc>
<input type="submit" value="Submit XML String">
</form>
</body>
</html>
... and here is the content of
Form4API Test2.xml
...
<?xml version="1.0" ?>
<ZohoCreator>
<application name="gkLab1">
<form name="Form4API">
<criteria>
<field name="Continent" compOperator="EQUALs" value="Europe"></field>
</criteria>
</form>
</application>
</ZohoCreator>
Can someone in support advise me of the error of my ways ?
Gaev