curl --request GET \
--url https://api.statisfy.com/v1/surveys/{survey_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.statisfy.com/v1/surveys/{survey_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.statisfy.com/v1/surveys/{survey_id}', 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.statisfy.com/v1/surveys/{survey_id}",
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: Bearer <token>"
],
]);
$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.statisfy.com/v1/surveys/{survey_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.statisfy.com/v1/surveys/{survey_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.statisfy.com/v1/surveys/{survey_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"definition": {},
"description": "<string>",
"email": {
"editor": "simple",
"html": "<string>",
"sender_email": "<string>",
"sender_name": "<string>",
"subject": "<string>"
},
"id": "<string>",
"state": "draft",
"theme": {},
"title": "<string>",
"type": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}Get one survey
Returns one survey with its questions, theme and email.
curl --request GET \
--url https://api.statisfy.com/v1/surveys/{survey_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.statisfy.com/v1/surveys/{survey_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.statisfy.com/v1/surveys/{survey_id}', 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.statisfy.com/v1/surveys/{survey_id}",
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: Bearer <token>"
],
]);
$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.statisfy.com/v1/surveys/{survey_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.statisfy.com/v1/surveys/{survey_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.statisfy.com/v1/surveys/{survey_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"definition": {},
"description": "<string>",
"email": {
"editor": "simple",
"html": "<string>",
"sender_email": "<string>",
"sender_name": "<string>",
"subject": "<string>"
},
"id": "<string>",
"state": "draft",
"theme": {},
"title": "<string>",
"type": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}Authorizations
An API key, sent as Authorization: Bearer stfy_live_…. See Authentication for how to get one and which scopes it needs.
Response
Successful Response
The survey's questions and pages: the SurveyJS JSON the app's survey builder saves (https://help.statisfy.com/rest-api/survey_definition). Elements sit in pages[].elements (or top-level elements) and in panels' elements; panels nest at most 10 deep. An element's type is one of boolean, checkbox, comment, dropdown, expression, file, html, image, imagepicker, matrix, matrixdropdown, matrixdynamic, multipletext, panel, paneldynamic, radiogroup, ranking, rating, signaturepad, tagbox, text. A question's name is the key its answers carry, so every question needs one and names must be unique. At most 1,000,000 characters as JSON. HTML in it (html elements, completedHtml) is stored as sent and cleaned where the survey renders
The SurveyJS theme JSON the app's survey builder saves (https://help.statisfy.com/rest-api/survey_definition#theme)
Was this page helpful?