Skip to content
Simpoll / API

Simpoll API guide

Simpoll API developer guide: pass your own parameters to a survey, receive answers on your site via POST, GET or JavaScript, and verify signatures.

Contents

1.1. Introduction

The Simpoll API connects your site with any Simpoll survey in several ways. Its main job is to send survey results to your site for further processing.

You can use the API for:

  • matching respondents with visitors of your site;
  • finding out which visitors completed the survey;
  • finding out how a visitor did on a quiz (passed or not);
  • getting the answers a visitor gave in the survey.

1.2. Flow chart

The flow looks like this:

  1. When you embed a survey on your site, you can pass it any extra parameters (for example, a user ID);
  2. The user completes the survey in the Simpoll frame;
  3. When the survey is finished, Simpoll calls the Result URL on your site and sends back the parameters it received from you (if any);
  4. Together with your parameters, Simpoll sends the survey results to the Result URL.

So besides delivering results, a survey can act as a “proxy” for any of your data.

Parameters can be sent to the Result URL in one of three ways:

POST method

Data is sent in the background, invisibly to the user and without their browser. The request is sent when the user clicks “Submit” on the last page of the survey.

GET method

The user's browser is redirected from the last page of the survey to the Result URL with the data added as GET parameters. In this mode the “Redirect after the survey” setting is ignored.

Calling a JavaScript function on your page

Your parameters and the survey results are passed to a JavaScript function on the page where the survey is embedded. The function has a fixed name and one argument: an object with your parameters and the survey results.

This method works in all modern browsers.

1.3. Data transfer security

The Simpoll API can sign the data it receives and sends. Signatures are optional, but they guarantee that nobody changes the data on the way.