Where can I use this?
You can transfer your survey answers from Surveypal to your own service. You can for example create a report or a dashboard to your BI service, which takes survey answers and shows you the trend.
Read how to integrate Surveypal and Microsoft Power BI (in Finnish) from our blog.
You can show customer answers in your website. For example if you have real estate company, you might like to add comments from happy customers to your website.
How to use it?
First you need to create an API credentials.
- Here are instructions how to create Basic authentication credentials
- If your Surveypal organization is created before 31.08.2022 then you can use also API key for authentication.
- Make sure that the survey or surveys are made with the same user name who created the API credentials or share surveys to this user.
If you want to take answers only from one survey, you need only query /survey/{id}/answers
- Replace {id} with your survey ID. You can find ID from Surveypal survey list when select survey and scroll down. After survey links there is also survey ID.
If you want to take answers from multiple surveys then you need two request:
- First take list of your surveys with request /surveys
- Then use that list of surveys and create loop which takes survey ID from the list and use it with request /survey/{id}/answers
- With this method it's good to use different user name and create a API key for that user. Then you can share only necessary surveys to that user and get those surveys to your survey list.
You can limit answer count and answer status with these parameters:
- from and to, for example ?from=2022-04-01T00:00:00&to=2022-04-30T00:00:00
- answerState, for example ?answerState=["incomplete","complete"] return incomplete and complete answers. If you don't add answerState parameter then you get only complete answers.
- offset and limit, for example add these to first request ?limit=500&offset=0 and when you get response then send next request and increase offset every time ?limit=500&offset=500
- if you don't add any limits then you might see "HTTP 502 Proxy Error" because there are too much responses and request takes too long
If your survey contains merged data (another survey responses) then you need to get merge identifier first and add it to your /survey/{id}/answers request:
- First take list of your survey merged data with request /survey/{id}/merges
- Add parameter merge to your /survey/{id}/answers request which value is merge identifier
GET https://my.surveypal.com/api/rest/survey/1798864011/answers?merge=1797810649
- If you have more than one merged data in your survey then you need to add every of those to own merge parameter
GET https://my.surveypal.com/api/rest/survey/1798864011/answers?merge=1797810649&merge=1797810648