User Guide

Guide

How to access Survey data through API?

GoSurvey provides the API that can be used to fetch the collected data to use it in internal system or with some external tools for various purposes like backup of the data, internal dashboard creation, client facing dashboard etc.…

These APIs need the APIKey for authentication purpose.
There are two APIs for this:

  • GetSurveyList — Get the list of the surveys
  • FetchSurveyData — Get the data for a given survey

Step 1: 
Login to your GoSurvey account with the same credentials you used while creating the account.

Step 2: 

Click the Profile icon at the top right.
Open the Setting tab.
Find API Key and copy it (use the copy button next to the key).



Step 3: Get the list of surveys (GetSurveyList)
This API will fetch all the surveys in your account. Each survey will have its own unique Id value.
HTTP Method
: GET
URL: https://api.gosurvey.in/api/rest/GetSurveyList
Header:

Key Value
ApiKey
Your API Key from Profile

Response:
{

  "Response": {
    "Success": true,
    "Data": [
      {
        "Name": "AGBA CSAT",
        "Id": "agbacsat",
        "IsPublished": false
      }
    ]
  }
}

Step 4: Get the data for a given survey (FetchSurveyData)
This API is used to fetch data for given surveyId in batch size of 500.
HTTP Method: GET
URL: https://api.gosurvey.in/api/rest/FetchSurveyData
Header:

Key Value
ApiKey
Your API Key from Profile
URL Parameters:
Parameter Type Required Description
SurveyId
String
Yes
The Id value from GetSurveyList API Call for given Survey.
OutputFormat
String
Yes
Allowed values – JSON and CSV. This defines how the response should be sent.
LastDataId
Int
Yes
Keep this as 0 for the first API call. This API will fetch maximum 500 records in a single API call. Now in case there are more than 500 data - and need to fetch the next set of data, set the LastDataId as 500. So LastDataId should be the last fetched data id as per the stored data for given survey

Response:
{

  "Data": [
    {
      "ID": 1,
      "Date Collected": "26-Aug-2024 11:57:45",
      "Survey End Time": "26-Aug-2024 12:13:49",
      "Duration (Seconds)": 964,
      "Upload Time": "26-Aug-2024 12:13:51",
      "User": "KP100",
      "Col_2668284": "Vandalur Zoo",
      "Col_2668243": "Malarvizhi",
      "Col_2668235": "1234567890",
      "Col_2668245": "Malar@g.mail.com",
      "Col_2668236": "Indian",
      "Col_2668285": "Female",
      "Col_2668286": "26 -30 years",
      "Col_2668287": "5 – 10 lacs",
      "Col_2668288": "Business",
      "Col_2668289": "6-10"
    }
  ],
  "Fields": {
    "ID": "ID",
    "Date Collected": "Date Collected",
    "Survey End Time": "Survey End Time",
    "Duration (Seconds)": "Duration (Seconds)",
    "Upload Time": "Upload Time",
    "User": "User",
    "Col_2668284": "Name of park",
    "Col_2668243": "Respondent Name:",
    "Col_2668235": "Mobile number",
    "Col_2668245": "E-mail:",
    "Col_2668236": "Nationality",
    "Col_2668285": "Gender",
    "Col_2668286": "Age (Completed years)",
    "Col_2668287": "Annual income (INR)",
    "Col_2668288": "Profession",
    "Col_2668289": "Number of visits to botanical gardens anywhere in India in a year"
  }
}

Note: The fields represent the unique column names for each of the questions configured in the survey. The ones without Col_ -- are system generated.