V1
Retrieve Surveys
Studies were formerly surveys. This endpoint allows for the export of study configurations. The name will eventually change to Study, but at this time survey will be accepted anywhere study appears in the API. This endpoint allows you retrieve up to 1000 surveys at a time.
GET
/
v1
/
surveys
Retrieve Surveys
curl --request GET \
--url https://api.sprig.com/v1/surveys \
--header 'Authorization: <authorization>'import requests
url = "https://api.sprig.com/v1/surveys"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.sprig.com/v1/surveys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sprig.com/v1/surveys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sprig.com/v1/surveys"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sprig.com/v1/surveys")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sprig.com/v1/surveys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"cursor": "Y3JlYXRlZEF0OjE1NTMyMDAxNTMwMTk=",
"data": [
{
"completedAt": "2019-06-12T19:23:35.522Z",
"constraints": [
{
"comparisonType": "gte",
"event": null,
"type": "SESSION_COUNT",
"value": 1
},
{
"comparisonType": "eq",
"event": null,
"type": "TIME_ON_PAGE_DELAY",
"value": 2
}
],
"createdAt": "2018-07-18T08:02:09.858Z",
"id": 12,
"launchedAt": null,
"name": "Understand Appeal",
"platform": "web",
"questions": [
{
"id": 118,
"options": [],
"optionsProperties": {
"introText": "Thanks for using Sprig. Tell us about your experience.",
"labels": {
"left": "Not at all interested",
"right": "Extremely interested"
}
},
"questionText": "How interested are you in using Sprig?",
"routingOptions": null,
"type": "LIKERT"
},
{
"id": 105,
"options": [],
"optionsProperties": null,
"questionText": "What aspect of Sprig is most appealing?",
"routingOptions": null,
"type": "OPEN"
}
],
"status": "COMPLETED",
"totalResponseLimit": null,
"type": "CONTINUOUS",
"updatedAt": "2019-06-12T19:23:35.522Z"
}
]
}{
"error": "<string>"
}Query Parameters
Was this page helpful?
⌘I
Retrieve Surveys
curl --request GET \
--url https://api.sprig.com/v1/surveys \
--header 'Authorization: <authorization>'import requests
url = "https://api.sprig.com/v1/surveys"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.sprig.com/v1/surveys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sprig.com/v1/surveys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sprig.com/v1/surveys"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sprig.com/v1/surveys")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sprig.com/v1/surveys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"cursor": "Y3JlYXRlZEF0OjE1NTMyMDAxNTMwMTk=",
"data": [
{
"completedAt": "2019-06-12T19:23:35.522Z",
"constraints": [
{
"comparisonType": "gte",
"event": null,
"type": "SESSION_COUNT",
"value": 1
},
{
"comparisonType": "eq",
"event": null,
"type": "TIME_ON_PAGE_DELAY",
"value": 2
}
],
"createdAt": "2018-07-18T08:02:09.858Z",
"id": 12,
"launchedAt": null,
"name": "Understand Appeal",
"platform": "web",
"questions": [
{
"id": 118,
"options": [],
"optionsProperties": {
"introText": "Thanks for using Sprig. Tell us about your experience.",
"labels": {
"left": "Not at all interested",
"right": "Extremely interested"
}
},
"questionText": "How interested are you in using Sprig?",
"routingOptions": null,
"type": "LIKERT"
},
{
"id": 105,
"options": [],
"optionsProperties": null,
"questionText": "What aspect of Sprig is most appealing?",
"routingOptions": null,
"type": "OPEN"
}
],
"status": "COMPLETED",
"totalResponseLimit": null,
"type": "CONTINUOUS",
"updatedAt": "2019-06-12T19:23:35.522Z"
}
]
}{
"error": "<string>"
}