1. Home
  2. Application Programming Interface
  3. Survalyzer’s API – Step by step instructions

Survalyzer’s API – Step by step instructions

This page is about Survalyzer Next Generation API.

Your Survalyzer account is either hosted in Switzerland or the European Union (Holland)

The API URL depends on the data center location.

for EU: https://api.survalyzer-eu.app

for Switzerland: https://api.survalyzer-swiss.app

Step 1: Get an access token

To get an access token, the following API must be called:
POST /publicapi/Authentication/v1/GetApiToken

Header:
charset: UTF-8
content-type: application/json

Body:
{
"username": "myUsername",
"password": "myPassword"
}

This request returns the following structure:
{
"$type":"GetApiTokenResponse",
"accessToken": {token},
"isSuccess":true,
"errorMessage":""
}

Step 2: Using the access token in subsequent calls

Receiving the access token will not result in a cookie which stores the access token. Therefore the token must be provided in the header of each subsequent call. The call of the ReadSurveyData method will look like this:


POST /publicapi/Survey/v1/ReadSurveyDataCompact

Header:
charset: UTF-8
content-type: application/json
Authorization: Bearer {token}

Body:
{
"surveyId":"4711",
"locale": "de"
}

Portals and Dashboards
Survalyzer also offers customers the option to create custom portals and dashboards for their clients.

Important to know
An access token is valid for eight hours. After this, the next call will return a status 401, meaning that the GetApiToken method must be called again to initiate another access token.

Updated on October 12, 2020

Was this article helpful?

Related Articles