Changes

Jump to: navigation, search

SmartConnect - RESTful API

2,769 bytes added, 14:07, 7 April 2021
Options and Settings
||Returns formatted content processed by the variable processor from a specified record.  The system will replace all variables within the content parameter with variable values from that record.  E.g. Passing in "Hello @firstname@" as content for a contact named John Smith will return "Hello John".
|}
===Pagination===
4 new parameters are introduced and should be put inside the "othersettings" in json object for the API call<br />- recordstart, recordend, recordsperpage, pagenum<br />*Note: othersettings parameter is also used for other settings introduced earlier, ie. getstorevalue and keyformat, so your othersettings json can look something like this:<br />{"getstorevalue":"1","keyformat":"1","recordsperpage":100,"recordstart":1000}
 
Note: only up to 10000 records will be returned for each API call, so multiple API calls will be required to display all records with respective pagination parameters<br /><br />Returned json response will include the following (in the message json node) for all records, despite the above parameters have been set or not, results are based on the order by (sortby declared in API call or by default order by, eg. order by L1 ID asc):<br />- recordfrom (starts from record number xxx)<br />- recordto (last record number returned xxx)<br />- recordcount (number of records returned in this API call)<br />- allcount (number of records in total without the limit)<br />Returned Response:<br />e.g. "message":{"recordto":424,"recordcount":100,"allcount":460,"recordfrom":325}<br /><br />Priority of operations with the 4 new parameters:<br />1. when recordend > 0, only recordstart and recordend parameter will be taken into consideration, eg.<br />othersettings: {"recordend":35} - will return records from start up to and including 35th record, total records = 35<br />othersettings: {"recordstart":10,"recordend":35} - will return 10th to 35th record, total records = 26<br />othersettings: {"recordstart":10,"recordend":350,"recordsperpage":100} - will ignore recordsperpage because you have specified the start and end, return record 10 to 350, total 341 records
 
<br />2. pagenum > 0 and recordsperpage > 0, (to use pagenum, recordsperpage has be to specified), will ignore recordstart and recordend<br />othersettings: {"recordsperpage":50,"pagenum":2} - return records 51-100<br />othersettings: {"recordsperpage":100,"recordstart":12,"pagenum":1} - will ignore recordstart, return records 1-100<br />othersettings: {"recordsperpage":100,"recordstart":12,"pagenum":3} - will ignore recordstart, return records 201-300
 
<br />3. recordsperpage > 0<br />othersettings: {"recordsperpage":100} - return record 1 to 100<br />othersettings: {"recordsperpage":100,"recordstart":1} - return record 1 to 100<br />othersettings: {"recordsperpage":100,"recordstart":101} - return record 101 to 200<br />othersettings: {"recordsperpage":100,"recordstart":325} - return record 325 to 424
 
<br />4. recordstart > 0<br />othersettings: {"recordstart":12}, return all records starting from record 12, up to only 10000 number of records
=SmartConnect Examples=
Smartstaff
124
edits

Navigation menu