Publish survey
curl --request POST \
--url https://api.pickfu.com/v1/surveys/{id}/publish \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pickfu.com/v1/surveys/{id}/publish"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pickfu.com/v1/surveys/{id}/publish', 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.pickfu.com/v1/surveys/{id}/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.pickfu.com/v1/surveys/{id}/publish"
req, _ := http.NewRequest("POST", 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.post("https://api.pickfu.com/v1/surveys/{id}/publish")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pickfu.com/v1/surveys/{id}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "<string>",
"name": "<string>",
"country": "<string>",
"sampleSize": 123,
"numResponses": 123,
"status": "<string>",
"targeting": [
"<string>"
],
"reporting": [
"<string>"
],
"reportingDefaultsApplied": [
"<string>"
],
"tags": [
{
"id": "<string>",
"name": "<string>"
}
],
"projects": [
{
"id": "<string>",
"name": "<string>"
}
],
"surveyUrl": "<string>",
"surveyIntent": "<string>",
"questions": [
{
"id": "<string>",
"type": "<string>",
"variant": "<string>",
"value": "<string>",
"translation": "<string>",
"options": [
{
"id": "<string>",
"label": "<string>",
"value": "<string>",
"type": "<string>",
"translation": "<string>",
"product": {
"asin": "<string>",
"title": "<string>",
"price": 123,
"salePrice": 123,
"rating": 123,
"reviews": 123,
"image": "<string>"
},
"imageSetDirection": "<string>",
"mockupType": "<string>"
}
],
"context": {
"type": "<string>",
"value": "<string>",
"translation": "<string>"
},
"results": {
"totalResponses": 123,
"winningOptionId": "<string>",
"averageScore": 123,
"options": [
{
"id": "<string>",
"label": "<string>",
"votes": 123,
"percentage": 123,
"rank": 123,
"isWinner": true
}
]
},
"responses": [
{
"id": "<string>",
"pinned": true,
"explanation": "<string>",
"translation": "<string>",
"chosenOption": "<string>",
"selectedOptions": [
"<string>"
],
"score": 123,
"clicks": [
{
"number": 123,
"xCoord": 123,
"yCoord": 123
}
],
"ranking": [
{
"rank": 123,
"option": "<string>"
}
],
"media": "<string>",
"mediaTranscription": "<string>",
"matchup": {
"option1": "<string>",
"option2": "<string>"
},
"statements": [
{
"id": "<string>",
"statement": "<string>",
"value": 123
}
],
"respondent": [
{
"trait": "<string>",
"value": "<string>"
}
]
}
],
"ai": {}
}
]
},
"cost": {
"amount": 123,
"balance": 123,
"currency": "<string>",
"canPayWithBalance": true,
"quotedCreditsCost": 123,
"creditsCostSubtotal": 123,
"discounts": [
[
"<string>"
]
],
"discountsMoney": [
[
"<string>"
]
],
"planRequired": "<string>"
}
}{
"statusCode": 123,
"error": "<string>",
"message": "<string>"
}"<string>""<string>""<string>"Surveys
Publish survey
Publishes a draft survey and begins collecting responses from the target audience.
Prerequisites
- Survey must be in
unpublished(draft) status - Account must have sufficient credits
- All required fields must be complete (at least one question with options)
After publishing, the survey status changes to pending or in-progress and credits are deducted from your account.
POST
/
surveys
/
{id}
/
publish
Publish survey
curl --request POST \
--url https://api.pickfu.com/v1/surveys/{id}/publish \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pickfu.com/v1/surveys/{id}/publish"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pickfu.com/v1/surveys/{id}/publish', 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.pickfu.com/v1/surveys/{id}/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.pickfu.com/v1/surveys/{id}/publish"
req, _ := http.NewRequest("POST", 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.post("https://api.pickfu.com/v1/surveys/{id}/publish")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pickfu.com/v1/surveys/{id}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "<string>",
"name": "<string>",
"country": "<string>",
"sampleSize": 123,
"numResponses": 123,
"status": "<string>",
"targeting": [
"<string>"
],
"reporting": [
"<string>"
],
"reportingDefaultsApplied": [
"<string>"
],
"tags": [
{
"id": "<string>",
"name": "<string>"
}
],
"projects": [
{
"id": "<string>",
"name": "<string>"
}
],
"surveyUrl": "<string>",
"surveyIntent": "<string>",
"questions": [
{
"id": "<string>",
"type": "<string>",
"variant": "<string>",
"value": "<string>",
"translation": "<string>",
"options": [
{
"id": "<string>",
"label": "<string>",
"value": "<string>",
"type": "<string>",
"translation": "<string>",
"product": {
"asin": "<string>",
"title": "<string>",
"price": 123,
"salePrice": 123,
"rating": 123,
"reviews": 123,
"image": "<string>"
},
"imageSetDirection": "<string>",
"mockupType": "<string>"
}
],
"context": {
"type": "<string>",
"value": "<string>",
"translation": "<string>"
},
"results": {
"totalResponses": 123,
"winningOptionId": "<string>",
"averageScore": 123,
"options": [
{
"id": "<string>",
"label": "<string>",
"votes": 123,
"percentage": 123,
"rank": 123,
"isWinner": true
}
]
},
"responses": [
{
"id": "<string>",
"pinned": true,
"explanation": "<string>",
"translation": "<string>",
"chosenOption": "<string>",
"selectedOptions": [
"<string>"
],
"score": 123,
"clicks": [
{
"number": 123,
"xCoord": 123,
"yCoord": 123
}
],
"ranking": [
{
"rank": 123,
"option": "<string>"
}
],
"media": "<string>",
"mediaTranscription": "<string>",
"matchup": {
"option1": "<string>",
"option2": "<string>"
},
"statements": [
{
"id": "<string>",
"statement": "<string>",
"value": 123
}
],
"respondent": [
{
"trait": "<string>",
"value": "<string>"
}
]
}
],
"ai": {}
}
]
},
"cost": {
"amount": 123,
"balance": 123,
"currency": "<string>",
"canPayWithBalance": true,
"quotedCreditsCost": 123,
"creditsCostSubtotal": 123,
"discounts": [
[
"<string>"
]
],
"discountsMoney": [
[
"<string>"
]
],
"planRequired": "<string>"
}
}{
"statusCode": 123,
"error": "<string>",
"message": "<string>"
}"<string>""<string>""<string>"Authorizations
OAuth2 access token obtained via the authorization flow. Include in the Authorization header as: Bearer {access_token}
Path Parameters
Survey ID
Was this page helpful?
⌘I
