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. Clients are requested to use this API.

Step 1: Get an access token

To get an access token, the following API must be called:
POST /publicapi/login/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/ReadSurveyData

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 May 19, 2020

Was this article helpful?

Related Articles