Forum Discussion
_anomDiebolt_
7 years agoQrew Elite
This is indeed a welcome and needed feature.
>We expect this to go live with our November release, with updates to the API documentation shortly thereafter.
Include this missing info in your API documentation:
The QuickBase HTTP API documentation overwhelmingly emphasizes and encourages using XML for both requests and responses. But forming XML requests can be verbose and overly complicated. Luckily you can send your request parameters as (1) URL encoded strings or (2) as formdata and depending on the language you are using there may well be a library or language feature that makes this dead simple. QuickBase will recognize these requests even though they do not use an XML body.
This is best demonstrated by an example. Assuming your CSV data is in the variable csvData and there are variables for apptoken and usertoken the following two code fragments demonstrates you don't need to send an XML body:
Using JavaScript and jQuery library:
Using JavaScript and Fetch API:
The point is that you don't need to send an XML body and alternatively QuickBase will recognize parameters passed as a URL encoded string or as formdata. This applies no matter what language or library you are using as it is an inherent feature of how QuickBase processes API requests.
Additionally, if you see an XML body being specified in some API call you can bust it down to a set of simple attribute/value parameters by removing the <qdbapi> tag altogether and just passing all the other tags as parameters. This procedure works for all API_*, QBI_* and JBI_* methods.
My advice is to NOT send XML bodies as it only makes your code bloated.
Proof That XML Is Extremely Bloated
https://www.zdnet.com/article/proof-that-xml-is-extremely-bloated/
>We expect this to go live with our November release, with updates to the API documentation shortly thereafter.
Include this missing info in your API documentation:
The QuickBase HTTP API documentation overwhelmingly emphasizes and encourages using XML for both requests and responses. But forming XML requests can be verbose and overly complicated. Luckily you can send your request parameters as (1) URL encoded strings or (2) as formdata and depending on the language you are using there may well be a library or language feature that makes this dead simple. QuickBase will recognize these requests even though they do not use an XML body.
This is best demonstrated by an example. Assuming your CSV data is in the variable csvData and there are variables for apptoken and usertoken the following two code fragments demonstrates you don't need to send an XML body:
Using JavaScript and jQuery library:
var object = {
act: "API_ImportFromCSV",
records_csv: csvData,
clist: clist, "6.7.8.9.10",
mergeFieldId: "10"
apptoken: apptoken,
usertoken: usertoken
};
$.post(dbid, object);
Using JavaScript and Fetch API:
var formData = new FormData();
formData.append("act", "API_ImportFromCSV");
formData.append("records_csv", csvData);
formData.append("clist", "6.7.8.9.10");
formData.append("mergeFieldId", "10");
formData.append("apptoken", apptoken);
formData.append("usertoken", usertoken);
fetch(dbid, {
method: "POST",
body: formData,
credentials: "include"
});
The point is that you don't need to send an XML body and alternatively QuickBase will recognize parameters passed as a URL encoded string or as formdata. This applies no matter what language or library you are using as it is an inherent feature of how QuickBase processes API requests.
Additionally, if you see an XML body being specified in some API call you can bust it down to a set of simple attribute/value parameters by removing the <qdbapi> tag altogether and just passing all the other tags as parameters. This procedure works for all API_*, QBI_* and JBI_* methods.
My advice is to NOT send XML bodies as it only makes your code bloated.
Proof That XML Is Extremely Bloated
https://www.zdnet.com/article/proof-that-xml-is-extremely-bloated/