Closed Kezzsim closed 3 years ago
I was able to make an example with some trial and error, basically Javascript Object == Java Struct Everything in the IFS API is Base 0 and MODULO is the wildcard character for some unknown reason
// Create an ifs object for all XML-RPC transactions.
var ifs = new api.DataContext('{IFSTOKEN}');
// Lead Source potential fields
var leadSourceFields = [
"Id",
"Name",
"Vendor",
"Status",
"StartDate",
"Message",
"Medium",
"LeadSourceCategoryId",
"EndDate",
"Description",
"CostPerLead"
];
ifs.DataService.query('LeadSource', 1000, 0, {"Id" : "%"}, leadSourceFields).then(leadSources => {
console.log(leadSources);
return leadSources;
}).catch(e => { console.log(e) });```
Hello again
This API is very useful, but I seem to have difficulties using the queries that infusionSoft provides in their documentation.
If I write something like:
Id => [1,2,3,4]
, one of the example queries copied from IFS's documentation, just seems to cause the program to crash with this:Error: XML-RPC fault: No method matching arguments: java.lang.String
In their documentation they say the query is of type "struct" but how do I declare that type inside javascript?
This really is a low priority thing but I'd appreciate the insight
Thank you