Getting an API XML Parsing Error when using the ImportFromCSV. Error code 11

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

Subject:Error With Quickbase API
Message:<?xml version="1.0" ?>
<qdbapi>
    <action>API_ImportFromCSV</action>
    <errcode>11</errcode>
    <errtext>Could not parse XML input</errtext>
    <errdetail>XML Parsing Error. mismatched tag at line 318 column 19 (which is byte 78432)</errdetail>
</qdbapi>



Right now, I have a CDATA wrapping the whole records_csv.  Is that right?  or should it be CDATA for each individual field?



Photo of Ryan

Ryan

  • 200 Points 100 badge 2x thumb

Posted 3 years ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb
Don't supply an XML payload via <qdbapi>. Just supply your records_csv as a string csv using this code:

$.post(dbid,{
  act: "API_ImportFromCSV",
  records_csv: csv,
  clist: clist
});
Photo of Ryan

Ryan

  • 200 Points 100 badge 2x thumb
Hey, additional on that, would you suggest that very large data dumps be sent by POST instead of XML ?  Is this just because of QuickBase?  Right now we have most of the API calls we make done by XML calls.  Thanks
Photo of Ryan

Ryan

  • 200 Points 100 badge 2x thumb
okay, i realized after posting, xml has to be parsed in memory..
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb
You are using a POST method if you are sending XML.

XML is not very a convenient method to send parameters to API calls and I rarely us it. Luckily QuickBase will accept most parameters view GET or POST query string format and using jQuery AJAX methods abstracts that process into simply specifying attribute/value pairs on AJAX calls.