While there is many ways to retrieve the data from our API. We have built a library to help our clients with this task. Syrup.js works by utilising a number of libraries to carry out a number of tasks on the API JSON data and providing a simple to understand output.
...
So how does it work?
Must include these Required Scripts
First you will need to include these custom JS scripts into the page that retries/triggers the API data retrial process. Otherwise the whole thing will not work!
...
we specify the key parameters first, such as the projectID
, pageID
and respondentID
. Naturally this an be dynamically changed/fed depending on each respondentthe clients survey platform. As this will then populate each field according to the system/parameters set by the Clients programmers. i.e. What is the respondentID etc..
Code Block | ||
---|---|---|
| ||
// Main function to read data from the CS API and process it async function doit() { // replace the projectID, pageID and respondentID with your own values r = await syrup.fetchRespondentData({ projectID: '0d3b3b33-ade0-42f4-baa3-3d15cc7f9724', pageID: 'bcf82dd7-8313-458e-b898-3ee9b51110f5', respondentID: 'DEMORSP', }) console.log('Respondent data is now loaded') |
...