Surveys allow you to collect data about your organization's enterprise architecture landscape from various stakeholders. Learn more about surveys in our user documentation.
As an administrator, you can manage surveys programmatically using the Poll REST API. In this guide, you will learn how to retrieve survey results through the Poll API.
📘
In the API reference and this guide, surveys are referred to as polls.
The Poll API allows you to manage the following data:
Polls: A poll is a template of a survey form that a survey creator sends out to recipients to collect the desired information for specific Fact Sheets. Each poll has a unique ID.
Poll runs: A poll run is an operation of sending a specific version of a poll to recipients. Each poll run has a unique ID.
Poll results: A poll result stores the answers of survey recipients for a specific Fact Sheet. Each Fact Sheet included in a poll run generates a poll result with a unique ID.
See how polls appear in the UI.
To navigate to polls in LeanIX EAM, in the Administration section, select Surveys under Advanced Settings. You see a list of polls for your Workspace. Each poll has a unique ID.
A list of polls in the Surveys section in the LeanIX EAM Administration
To navigate to poll runs, select a poll in the Surveys list, and then go to Status & results. Each poll run that appears in the list has a unique ID.
A list of poll runs for an example poll
To navigate to poll run details, on the Status & results tab, select a poll run. Each Fact Sheet in the poll run that appears on the Fact Sheets tab of the overlay generates a unique poll result ID.
In all API requests listed on this page, replace {ACCESS_TOKEN} with your access token.
API Reference
You can view the reference documentation for the Poll API in the OpenAPI Explorer. The base URL differs for different customers, so make sure to use the right link.
To navigate to the OpenAPI Explorer from your Workspace, on the user menu, select About LeanIX, and then select Browse API. In the OpenAPI Explorer, select Poll in the upper-right corner.
Step 1. Get the Poll ID
First, let's get the identifier of the poll for which you want to retrieve results. Call the following endpoint:
GET https://{SUBDOMAIN}.leanix.net/services/poll/v2/polls
👍
How do I get my {SUBDOMAIN} value?
Copy the subdomain value from your Workspace URL. Learn more about the base URL.
Example subdomain in a Workspace URL
Example Request
Let's retrieve a poll by its title using the q query parameter (Location in the example).
The values for page, size, and sort are default in the example request.
The response contains poll results for all Fact Sheets included in the poll run. Each result is associated with a specific Fact Sheet and has a unique ID.
{
"status": "OK",
"type": "PollResultDTO",
"errors": [],
"total": 2,
"data": [
{
"id": "10fd7951-1e44-4643-{...}-ed5db8c44e29",
"pollRunId": "ce6a4af8-7060-4adc-{...}-2daa85efe616",
"status": "DONE",
"answers": [
{
"questionId": "cc2a3670-9d9d-5e41-{...}-c579cdd89b1c",
"answer": [
"Users are based in Australia."
],
...
{
"id": "2dff1a8b-33b6-494c-b855-c8604045e333",
"pollRunId": "ce6a4af8-7060-4adc-{...}-2daa85efe616",
"status": "DONE",
"answers": [
{
"questionId": "cc2a3670-9d9d-5e41-{...}-c579cdd89b1c",
"answer": [
"Users are based in Brazil."
],
...
}
Get a Result for a Specific Fact Sheet in a Poll Run
You can get a result for a specific Fact Sheet included in a poll run by the result ID. First, retrieve all results, and then save the id of the desired result from the response.
To retrieve a specific poll result, call the following endpoint:
GET https://{SUBDOMAIN}.leanix.net/services/poll/v2/pollResults/{pollResultID}