POST: https://{{env}}.survey2connect.com/v2/api/surveys/{{surId}}/responses/spss

The value of environment {{env}} variable depends upon your datacenter. Refer to the Environment page for more details.

"Content-Type": "application/json"
type: Api Key  
Key: x-api-key 
token: value from portal 

Request Parameters

{{surId}}: Unique Survey ID

Request Body

{ 
    "timeFilter": { 
        "amount": 2, 
        "period":"days", 
        "type":"rolling" 
    }, 
    "status": ["1"], 
    "paginationDetails": { 
        "skip": 0, 
        "limit":100 
    } 
}  

Supported Filters

Field Type Mandatory Description
timeFilter Object No
Rolling Filter (e.g. Last 7 days, Last 3 months etc.)
{
   amount:7,
   period:"days/months/years"
   type:"rolling"
}
Before/After Time filter (e.g. before Nov 1st 2020, After July 15th 2020)
{
   operand: ["dd/mm/yyyy"]
   type: "before/after"
}
Relative Time Filter (e.g. Today, This Month, Last Month, Previous Year)
{
   amount: 7,
   period: "day/month/year/week",
   type: "relative"
}
Between Time Filter (e.g. between July 15th 2020 & Nov 1st 2020)
{
   operand:["dd/mm/yyyy","dd/mm/yyyy"]
   type:"between"
}
status Array No
Integer(0-2)
0 : Incomplete/Partial Responses
1: Complete Responses
2 : Disqualified Responses
collectorIds Array No
Array of collector ids
paginationDetails Object No
{
   "skip": 0,
   "limit":100
}

Request Sample

curl --location --request POST 'https://az1.survey2connect.com/v2/api/surveys/6368975d8f142e56a6557ccb/responses/spss' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJraWQiOiJzM3E1OWF2cFdIcXVKa0I0MjRpcFpqQVN0dXAzQzFkZEhVM3k2TjNZSXRjPSIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiI0MTIxMDc1NC01ODVkLTRjNmQtODc2NC02Mzg0NzJkYTRhODEiLCJ6b25laW5mbyI6InByb2RfYXoxIiwiZW1haWxfdmVyaWZpZWQiOnRydWUsImN1c3RvbTpwYXNzd29yZFRvQmVSZXNldCI6ImZhbHNlIiwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLmFwLXNvdXRoLTEuYW1hem9uYXdzLmNvbVwvYXAtc291dGgtMV9zalNzc2JrOXYiLCJwaG9uZV9udW1iZXJfdmVyaWZpZWQiOmZhbHNlLCJjdXN0b206dUlkIjoiNjExYmEzNTcwZjdhNDEyNDYxM2MyMzg2IiwiY29nbml0bzp1c2VybmFtZSI6IjQxMjEwNzU0LTU4NWQtNGM2ZC04NzY0LTYzODQ3MmRhNGE4MSIsImF1ZCI6Ijg1azh1b2RqODBpazUzb2F0cDRycWJsYmMiLCJldmVudF9pZCI6IjE1NWYzNDA5LTkxOTQtNGIwOC05NzI1LTk1ZjEyOTViMGRjMSIsInRva2VuX3VzZSI6ImlkIiwiYXV0aF90aW1lIjoxNjY5MTgzOTQ3LCJjdXN0b206c3RhdHVzIjoiYWN0aXZlIiwibmFtZSI6IlRlc3QgRCIsInBob25lX251bWJlciI6Iis5MTc0MTc0NjExNzYiLCJleHAiOjE2NjkyNzAzNDcsImN1c3RvbTpyb2xlIjoiYnJhbmRBZG1pbiIsImlhdCI6MTY2OTE4Mzk0NywiZW1haWwiOiJkYXZpbmRlci5zQHN1cnZleTJjb25uZWN0LmNvbSJ9.TCnoiWVPKpMQq9ygME2y-arC653tbTu8Rpm6ziyWDjAhkfiEP42LiGYPAOHJrPb_G5AzGlbKeKeDhx7DCKKGb9ZVg36ltiCOH3KapscL2PB_6qeKDXZfGTDUjUqxVjsuFXeLVGRIUpmgEjQq3f8lnKLEBHPspwvbxZ7jcSuk9BAO2VDAtdPulmiYF7NhfBQ2xXdpYaJiJxJPkdz-vZfvofRITKTu8XgozT0IRTHJ5lP3yYLc9asDflYNs-np2g4bwn8St_lEOT6abhOpoH6DpHT1yNaP7w1zQ3U0lXCaZ4imGp7ETZ5kYpuRMuJ8bINUCZHyi8uQF-rZkv6Fk6-Gmg' \
--data-raw '{ "timeFilter": {
"amount": 2,
"period":"days",
"type":"rolling"
},
"status": ["1"],
"paginationDetails": {
"skip": 0,
"limit":100
}
} '
var myHeaders = new Headers(); 
myHeaders.append("Authorization", "Bearer eyJraWQiOiJzM3E1OWF2cFdIcXVKa0I0MjRpcFpqQVN0dXAzQzFkZEhVM3k2TjNZSXRjPSIsImFs"); 
myHeaders.append("Content-Type", "application/json"); 
var raw = JSON.stringify({ 
  "timeFilter": { 
    "amount": 2, 
    "period": "days", 
    "type": "rolling" 
  }, 
  "status": [ 
    "1" 
  ], 
  "paginationDetails": { 
    "skip": 0, 
    "limit": 100 
  } 
}); 
var requestOptions = { 
  method: 'POST', 
  headers: myHeaders, 
  body: raw, 
  redirect: 'follow' 
}; 
fetch("https://az1.survey2connect.com/v2/api/surveys/63281de56d497d12b49199c1/responses/spss", requestOptions) 
  .then(response => response.text()) 
  .then(result => console.log(result)) 
  .catch(error => console.log('error', error));

Responses

{ 
    "data": { 
        "varName": [ 
            "RespondentID", 
            "ResponseStatus", 
            "Language", 
            "CollectorNm", 
            "CollectorID", 
            "SentDate", 
            "StartDate", 
            "EndDate", 
            "TimeDuration", 
            "IPAddress", 
            "Device", 
            "SurveyVersion", 
            "EmailAddress", 
            "FirstName", 
            "LastName", 
            "Mobile", 
            "ExternalUniqueID", 
            "Latitude", 
            "Longitude", 
            "ByTicket", 
            "Tickets", 
            "verification_status", 
            "Q1", 
            "Q2_R1" 
        ], 
        "varTypes": { 
            "CollectorNm": 750, 
            "RespondentID": 30, 
            "ResponseStatus": 30, 
            "Language": 50, 
            "CollectorID": 30, 
            "SentDate": 50, 
            "StartDate": 50, 
            "EndDate": 50, 
            "TimeDuration": 30, 
            "IPAddress": 100, 
            "Device": 50, 
            "SurveyVersion": 50, 
            "EmailAddress": 50, 
            "FirstName": 50, 
            "LastName": 50, 
            "Mobile": 100, 
            "ExternalUniqueID": 50, 
            "Latitude": 50, 
            "Longitude": 50, 
            "ByTicket": 50, 
            "Tickets": 50, 
            "Q1": 0, 
            "Q2_R1": 0, 
            "verification_status": 0 
        }, 
        "valLabels": { 
            "Q1": { 
                "1": "male", 
                "2": "female" 
            } 
        }, 
        "varLabels": { 
            "CollectorNm": "Collector Name", 
            "RespondentID": "Respondent Unique Id", 
            "ResponseStatus": "Response Status", 
            "Language": "Language", 
            "CollectorID": "Collector Unique Id", 
            "SentDate": "Sent Date", 
            "StartDate": "Start Date", 
            "EndDate": "End Date", 
            "TimeDuration": "Time Duration", 
            "IPAddress": "IP Address", 
            "Device": "Device Information", 
            "SurveyVersion": "Survey Version", 
            "EmailAddress": "Email Address", 
            "FirstName": "First Name", 
            "LastName": "Last Name", 
            "Mobile": "Mobile", 
            "ExternalUniqueID": "External Unique ID", 
            "Latitude": "Location Latitude", 
            "Longitude": "Location Longitude", 
            "ByTicket": "By Ticket", 
            "Tickets": "Ticket(s) Generated", 
            "Q1": "What is your gender ?", 
            "Q2_R1": "Please rate our service.", 
            "verification_status": "verification_status" 
        }, 
        "records": [ 
            [ 
                "633401ecb9fa677c7787da94", 
                "Completed", 
                "eng_us", 
                "Web Link 4", 
                "633401e145d42a3538db27e6", 
                "", 
                "2022-09-28 13:42:29", 
                "2022-09-28 13:42:32", 
                "0.08 m", 
                "15.206.198.203", 
                "Desktop Chrome", 
                2, 
                "", 
                "", 
                "", 
                "", 
                "", 
                "", 
                "", 
                "", 
                "", 
                "", 
                "male", 
                "7" 
            ], 
            [ 
                "633401f45512747bbe0e197b", 
                "Completed", 
                "eng_us", 
                "Web Link 4", 
                "633401e145d42a3538db27e6", 
                "", 
                "2022-09-28 13:42:37", 
                "2022-09-28 13:42:39", 
                "0.06 m", 
                "15.206.198.203", 
                "Desktop Chrome", 
                2, 
                "", 
                "", 
                "", 
                "", 
                "", 
                "", 
                "", 
                "", 
                "", 
                "", 
                "female", 
                "9" 
            ] 
        ] 
    }, 
    "skip": 0, 
    "limit": 100 
} 
{ 
    "error": { 
        "name": "Unauthorized", 
        "message": "The authorization token was not provided." 
    } 
} 
{   
    "error": {   
         "name": "Internal Server Error",   
         "message": "We were not able to process your request"   
    }   
}

Get Response Count

POST: https://{{env}}.survey2connect.com/v2/api/surveys/{{surId}}/response-count The value of environment {{env}} variable depends upon your datacenter. Refer to the Environment page for more details.…

Get Responses (CSV format)

POST: https://{{env}}.survey2connect.com/v2/api/surveys/{{surId}}/responses/csv The value of environment {{env}} variable depends upon your datacenter. Refer to the Environment page for more details.…

Get Responses (JSON Format)

POST: https://{{env}}.survey2connect.com/v2/api/surveys/{{surId}}/responses/json The value of environment {{env}} variable depends upon your datacenter. Refer to the Environment page for more details.…

Ask a human

Can't Find What You're Looking For?