EXTERNAL REAL-TIME
INFORMATION

Integrated Into
Online Surveys

If you want to conduct an online survey that refers to frequently changing information, or needs to extract relevant information from a large database, you’ll need to connect your survey to an external source via an API. This is easily achievable with Nfield Online.
There is a wide range of scenarios which might call for this. To give just a few examples, you might want to show:
 
  • Today’s TV programs
  • A product list filtered by previously selected answers
  • Respondent information from your CRM
  • The respondent’s latest purchase history

Or you might need to utilize real-time information to route your survey according to current stock status.

How To Connect To Your External Source

The connection to your external source consists of one or two components:
 
  • a URL (always necessary) and
  • parameters (optional)

To illustrate how it works, let’s take a look at the Cryptocurrency demo we’ve set up. This demo survey connects to https://cex.io/api/tickers/USD/EUR to retrieve the latest cryptocurrency prices. As you can see, this URL takes you some JSON code. Copying this code into a JSON editor will present it as shown in the illustration below. Note that Nfield will only load the content from the “data” section and will ignore other information.

API-2.png
Step 1 is therefore to identify the URL to connect to your survey. However, every survey has its own unique requirements and ready-made API URLs are rarely available. Your IT team will actually need to create the URL(s) that return the relevant JSON format data results. Of course, NIPO can provide any support you need for doing this.

Step 2 is to set this up in Nfield Online. Under Survey Default Settings, simply add the URL as an API end point and give it a name. Doing this tells Nfield that calling “CryptoCurrency” from the survey script refers to a call to this particular URL.

API-1.png

Step 3 is to call the API from your survey setup.

API-3.png

The call status is stored in “result” and the answers are stored in the arrays of var1 and var2. In our example var1 is filled with the ‘pair’ info and var2 with ‘ask’ (asking price) information, so our *GETDATA command looks like this:

*GETDATA result pair,ask "CryptoCurrency:"

Note that our demo example doesn’t utilize the second component option for parameters.

Always Here To Help

We hope this article inspires you to explore the possibilities opened up by the use of API endpoints. If you have any questions or require any assistance, please feel free to contact us.


Get in touch

+31 (0) 20 5225 989 hello@nipo.com
Meet NIPO Team

NIPO News update

NIPO News update

Get notified when we publish new handy tips and important news about Nfield