curl --request POST \
--url https://api.statisfy.com/v1/integrations/pendo/surveys/runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"end_date": "<string>",
"start_date": "<string>"
}
'import requests
url = "https://api.statisfy.com/v1/integrations/pendo/surveys/runs"
payload = {
"end_date": "<string>",
"start_date": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({end_date: '<string>', start_date: '<string>'})
};
fetch('https://api.statisfy.com/v1/integrations/pendo/surveys/runs', 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/integrations/pendo/surveys/runs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'end_date' => '<string>',
'start_date' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.statisfy.com/v1/integrations/pendo/surveys/runs"
payload := strings.NewReader("{\n \"end_date\": \"<string>\",\n \"start_date\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.statisfy.com/v1/integrations/pendo/surveys/runs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"end_date\": \"<string>\",\n \"start_date\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.statisfy.com/v1/integrations/pendo/surveys/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"end_date\": \"<string>\",\n \"start_date\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"run_id": 123,
"started_at": "2023-11-07T05:31:56Z",
"status": "scheduled"
}{
"message": "<string>",
"run_id": 123,
"started_at": "2023-11-07T05:31:56Z",
"status": "scheduled"
}Run the Pendo NPS survey job now
Starts the NPS survey job (202), as Run now of the survey subtype does on the app’s monitoring page. The job has no saved query: it reads the survey settings of GET /v1/integrations/pendo/config. With no dates, the window starts at the earlier of 8 days ago and 1 day before the start of the last completed run, and never more than 90 days back. start_date and end_date (YYYY-MM-DD, sent together, at most 90 days apart) read that window again: a response that is already stored is skipped. When a run of the job is already in flight, nothing starts and that run comes back (200, already_running). A 409 means the CRM has not synced yet, which every non-CRM integration waits for, or that Pendo has no saved config (version 0), where the job would read nothing: save the survey settings first. Poll GET /v1/integrations/pendo/runs/ for the outcome.
curl --request POST \
--url https://api.statisfy.com/v1/integrations/pendo/surveys/runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"end_date": "<string>",
"start_date": "<string>"
}
'import requests
url = "https://api.statisfy.com/v1/integrations/pendo/surveys/runs"
payload = {
"end_date": "<string>",
"start_date": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({end_date: '<string>', start_date: '<string>'})
};
fetch('https://api.statisfy.com/v1/integrations/pendo/surveys/runs', 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/integrations/pendo/surveys/runs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'end_date' => '<string>',
'start_date' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.statisfy.com/v1/integrations/pendo/surveys/runs"
payload := strings.NewReader("{\n \"end_date\": \"<string>\",\n \"start_date\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.statisfy.com/v1/integrations/pendo/surveys/runs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"end_date\": \"<string>\",\n \"start_date\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.statisfy.com/v1/integrations/pendo/surveys/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"end_date\": \"<string>\",\n \"start_date\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"run_id": 123,
"started_at": "2023-11-07T05:31:56Z",
"status": "scheduled"
}{
"message": "<string>",
"run_id": 123,
"started_at": "2023-11-07T05:31:56Z",
"status": "scheduled"
}Authorizations
An API key, sent as Authorization: Bearer stfy_live_…. See Authentication for how to get one and which scopes it needs.
Body
Response
Successful Response
Was this page helpful?