Survey Management
Overview
This page gives you a short overview of how to use our Poll API to do the survey management in your Workspace programmatically. An API token is needed to authenticate, for details please see Technical User. The goal of this documentation is to extract the results of a survey.
GET Poll ID
The following example shows how to do this by a GET to the /polls
endpoint of our Poll API. You need your workspace ID as an argument. You'll find this information in the admin area of your workspace under the API Token section.
With this call, you can find out the Poll ID of your Survey run.
curl -X GET
--header 'Accept: application/json'
--header 'Authorization: Bearer eyJhbGciOiJSU[...]'
'https://app.leanix.net/services/poll/v2/polls?page=1&size=30&sort=creationDate-desc&workspaceId=workspaceID'
GET Poll Run ID
With the Poll ID as an argument, you can use the following call to get the Poll Run ID.
curl -X GET
--header 'Accept: application/json'
--header 'Authorization: Bearer eyJhbGciOiJSU[...]'
'https://app.leanix.net/services/poll/v2/polls/107b6d1f-e2d6-4dde-acdb-eb4c51636a2c/pollRuns?page=1&size=500&sort=startTime-desc'
GET Results for Poll Run
With the Poll Run ID as an argument, you can use the following call to get the Poll Result ID.
curl -X GET
--header 'Accept: application/json'
--header 'Authorization: Bearer eyJhbGciOiJSU[...]'
'https://app.leanix.net/services/poll/v2/pollRuns/6ae0d8db-05a5-4452-8636-b69a3f3a6792/pollResults'
GET Poll results
With the Poll Result ID, you can use the following call to get the results of your poll run.
curl -X GET
--header 'Accept: application/json'
--header 'Authorization: Bearer eyJhbGciOiJSU[...]' 'https://app.leanix.net/services/poll/v2/pollResults/107b6d1f-e2d6-4dde-acdb-eb4c51636a2c'
Updated 3 months ago