Create Survey
curl --request POST \
--url https://api.birdeye.com/resources/v1/survey/external/create/{businessId} \
--header 'Content-Type: application/json' \
--data '
{
"surveyName": "Experience Survey",
"thankYouMessage": "Thank you for taking the survey!",
"surveyType": "traditional",
"ownerEmailId": "testmail@gmail.com",
"pages": [
{
"questions": [
{
"title": "Text1",
"type": "text"
},
{
"title": "Paragraph",
"type": "textarea"
}
]
},
{
"title": "Page 2-optional",
"questions": [
{
"title": "Questionnumber1",
"type": "checkbox",
"required": true,
"choices": [
"Choice 1",
"Choice 2",
"Choice 3"
]
},
{
"title": "Q2",
"type": "dropdown",
"choices": [
"Dropdown 1",
"Dropdown 2",
"Dropdown 3"
]
},
{
"title": "ratingQn",
"type": "rating",
"minLabel": "Strongly Disagree",
"maxLabel": "Strongly Agree",
"maxValue": 10
}
]
},
{
"questions": [
{
"title": "P3-Q1-Radio",
"type": "radio",
"choices": [
"radio 1",
"radio 2",
"radio 3"
]
},
{
"title": "npsQn",
"type": "nps",
"minLabel": "Strongly Disagree"
}
]
},
{
"questions": [
{
"title": "Datetime question",
"type": "datetime",
"required": true,
"showTime": true,
"showDate": true,
"interval": 60,
"minValue": "12",
"maxValue": "36"
},
{
"title": "Please enter your contact information",
"type": "contact",
"required": true,
"contactRows": [
{
"required": true,
"title": "First name",
"type": "text"
},
{
"required": true,
"title": "Email",
"type": "email"
},
{
"required": true,
"title": "Phone",
"type": "phone"
}
]
}
]
},
{
"title": "Page 4",
"questions": [
{
"title": "P4-Q1",
"type": "matrixrating",
"minLabel": "Strongly Disagree",
"maxLabel": "Strongly Agree",
"maxValue": 5,
"rows": [
"Row label 1",
"Row label 2"
]
},
{
"title": "P4-Q2",
"type": "matrixradio",
"required": true,
"choices": [
"c1",
"c2",
"c3"
],
"rows": [
"Row 1",
"Row2"
]
},
{
"title": "p4-Q3",
"type": "matrixdropdown",
"required": true,
"choices": [
"c1",
"c2",
"c3"
],
"rows": [
"Row label 1",
"Row label 2"
]
},
{
"title": "Label type ques",
"type": "label"
}
]
},
{
"questions": [
{
"title": "please review us on one of these sites",
"type": "review",
"required": true,
"contactUsMessage": "ContactUs test message",
"reviewSources": [
"Google",
"Facebook",
"CitySearch"
]
}
]
}
]
}
'import requests
url = "https://api.birdeye.com/resources/v1/survey/external/create/{businessId}"
payload = {
"surveyName": "Experience Survey",
"thankYouMessage": "Thank you for taking the survey!",
"surveyType": "traditional",
"ownerEmailId": "testmail@gmail.com",
"pages": [{ "questions": [
{
"title": "Text1",
"type": "text"
},
{
"title": "Paragraph",
"type": "textarea"
}
] }, {
"title": "Page 2-optional",
"questions": [
{
"title": "Questionnumber1",
"type": "checkbox",
"required": True,
"choices": ["Choice 1", "Choice 2", "Choice 3"]
},
{
"title": "Q2",
"type": "dropdown",
"choices": ["Dropdown 1", "Dropdown 2", "Dropdown 3"]
},
{
"title": "ratingQn",
"type": "rating",
"minLabel": "Strongly Disagree",
"maxLabel": "Strongly Agree",
"maxValue": 10
}
]
}, { "questions": [
{
"title": "P3-Q1-Radio",
"type": "radio",
"choices": ["radio 1", "radio 2", "radio 3"]
},
{
"title": "npsQn",
"type": "nps",
"minLabel": "Strongly Disagree"
}
] }, { "questions": [
{
"title": "Datetime question",
"type": "datetime",
"required": True,
"showTime": True,
"showDate": True,
"interval": 60,
"minValue": "12",
"maxValue": "36"
},
{
"title": "Please enter your contact information",
"type": "contact",
"required": True,
"contactRows": [
{
"required": True,
"title": "First name",
"type": "text"
},
{
"required": True,
"title": "Email",
"type": "email"
},
{
"required": True,
"title": "Phone",
"type": "phone"
}
]
}
] }, {
"title": "Page 4",
"questions": [
{
"title": "P4-Q1",
"type": "matrixrating",
"minLabel": "Strongly Disagree",
"maxLabel": "Strongly Agree",
"maxValue": 5,
"rows": ["Row label 1", "Row label 2"]
},
{
"title": "P4-Q2",
"type": "matrixradio",
"required": True,
"choices": ["c1", "c2", "c3"],
"rows": ["Row 1", "Row2"]
},
{
"title": "p4-Q3",
"type": "matrixdropdown",
"required": True,
"choices": ["c1", "c2", "c3"],
"rows": ["Row label 1", "Row label 2"]
},
{
"title": "Label type ques",
"type": "label"
}
]
}, { "questions": [
{
"title": "please review us on one of these sites",
"type": "review",
"required": True,
"contactUsMessage": "ContactUs test message",
"reviewSources": ["Google", "Facebook", "CitySearch"]
}
] }]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
surveyName: 'Experience Survey',
thankYouMessage: 'Thank you for taking the survey!',
surveyType: 'traditional',
ownerEmailId: 'testmail@gmail.com',
pages: [
{
questions: [{title: 'Text1', type: 'text'}, {title: 'Paragraph', type: 'textarea'}]
},
{
title: 'Page 2-optional',
questions: [
{
title: 'Questionnumber1',
type: 'checkbox',
required: true,
choices: ['Choice 1', 'Choice 2', 'Choice 3']
},
{
title: 'Q2',
type: 'dropdown',
choices: ['Dropdown 1', 'Dropdown 2', 'Dropdown 3']
},
{
title: 'ratingQn',
type: 'rating',
minLabel: 'Strongly Disagree',
maxLabel: 'Strongly Agree',
maxValue: 10
}
]
},
{
questions: [
{
title: 'P3-Q1-Radio',
type: 'radio',
choices: ['radio 1', 'radio 2', 'radio 3']
},
{title: 'npsQn', type: 'nps', minLabel: 'Strongly Disagree'}
]
},
{
questions: [
{
title: 'Datetime question',
type: 'datetime',
required: true,
showTime: true,
showDate: true,
interval: 60,
minValue: '12',
maxValue: '36'
},
{
title: 'Please enter your contact information',
type: 'contact',
required: true,
contactRows: [
{required: true, title: 'First name', type: 'text'},
{required: true, title: 'Email', type: 'email'},
{required: true, title: 'Phone', type: 'phone'}
]
}
]
},
{
title: 'Page 4',
questions: [
{
title: 'P4-Q1',
type: 'matrixrating',
minLabel: 'Strongly Disagree',
maxLabel: 'Strongly Agree',
maxValue: 5,
rows: ['Row label 1', 'Row label 2']
},
{
title: 'P4-Q2',
type: 'matrixradio',
required: true,
choices: ['c1', 'c2', 'c3'],
rows: ['Row 1', 'Row2']
},
{
title: 'p4-Q3',
type: 'matrixdropdown',
required: true,
choices: ['c1', 'c2', 'c3'],
rows: ['Row label 1', 'Row label 2']
},
{title: 'Label type ques', type: 'label'}
]
},
{
questions: [
{
title: 'please review us on one of these sites',
type: 'review',
required: true,
contactUsMessage: 'ContactUs test message',
reviewSources: ['Google', 'Facebook', 'CitySearch']
}
]
}
]
})
};
fetch('https://api.birdeye.com/resources/v1/survey/external/create/{businessId}', 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.birdeye.com/resources/v1/survey/external/create/{businessId}",
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([
'surveyName' => 'Experience Survey',
'thankYouMessage' => 'Thank you for taking the survey!',
'surveyType' => 'traditional',
'ownerEmailId' => 'testmail@gmail.com',
'pages' => [
[
'questions' => [
[
'title' => 'Text1',
'type' => 'text'
],
[
'title' => 'Paragraph',
'type' => 'textarea'
]
]
],
[
'title' => 'Page 2-optional',
'questions' => [
[
'title' => 'Questionnumber1',
'type' => 'checkbox',
'required' => true,
'choices' => [
'Choice 1',
'Choice 2',
'Choice 3'
]
],
[
'title' => 'Q2',
'type' => 'dropdown',
'choices' => [
'Dropdown 1',
'Dropdown 2',
'Dropdown 3'
]
],
[
'title' => 'ratingQn',
'type' => 'rating',
'minLabel' => 'Strongly Disagree',
'maxLabel' => 'Strongly Agree',
'maxValue' => 10
]
]
],
[
'questions' => [
[
'title' => 'P3-Q1-Radio',
'type' => 'radio',
'choices' => [
'radio 1',
'radio 2',
'radio 3'
]
],
[
'title' => 'npsQn',
'type' => 'nps',
'minLabel' => 'Strongly Disagree'
]
]
],
[
'questions' => [
[
'title' => 'Datetime question',
'type' => 'datetime',
'required' => true,
'showTime' => true,
'showDate' => true,
'interval' => 60,
'minValue' => '12',
'maxValue' => '36'
],
[
'title' => 'Please enter your contact information',
'type' => 'contact',
'required' => true,
'contactRows' => [
[
'required' => true,
'title' => 'First name',
'type' => 'text'
],
[
'required' => true,
'title' => 'Email',
'type' => 'email'
],
[
'required' => true,
'title' => 'Phone',
'type' => 'phone'
]
]
]
]
],
[
'title' => 'Page 4',
'questions' => [
[
'title' => 'P4-Q1',
'type' => 'matrixrating',
'minLabel' => 'Strongly Disagree',
'maxLabel' => 'Strongly Agree',
'maxValue' => 5,
'rows' => [
'Row label 1',
'Row label 2'
]
],
[
'title' => 'P4-Q2',
'type' => 'matrixradio',
'required' => true,
'choices' => [
'c1',
'c2',
'c3'
],
'rows' => [
'Row 1',
'Row2'
]
],
[
'title' => 'p4-Q3',
'type' => 'matrixdropdown',
'required' => true,
'choices' => [
'c1',
'c2',
'c3'
],
'rows' => [
'Row label 1',
'Row label 2'
]
],
[
'title' => 'Label type ques',
'type' => 'label'
]
]
],
[
'questions' => [
[
'title' => 'please review us on one of these sites',
'type' => 'review',
'required' => true,
'contactUsMessage' => 'ContactUs test message',
'reviewSources' => [
'Google',
'Facebook',
'CitySearch'
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"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.birdeye.com/resources/v1/survey/external/create/{businessId}"
payload := strings.NewReader("{\n \"surveyName\": \"Experience Survey\",\n \"thankYouMessage\": \"Thank you for taking the survey!\",\n \"surveyType\": \"traditional\",\n \"ownerEmailId\": \"testmail@gmail.com\",\n \"pages\": [\n {\n \"questions\": [\n {\n \"title\": \"Text1\",\n \"type\": \"text\"\n },\n {\n \"title\": \"Paragraph\",\n \"type\": \"textarea\"\n }\n ]\n },\n {\n \"title\": \"Page 2-optional\",\n \"questions\": [\n {\n \"title\": \"Questionnumber1\",\n \"type\": \"checkbox\",\n \"required\": true,\n \"choices\": [\n \"Choice 1\",\n \"Choice 2\",\n \"Choice 3\"\n ]\n },\n {\n \"title\": \"Q2\",\n \"type\": \"dropdown\",\n \"choices\": [\n \"Dropdown 1\",\n \"Dropdown 2\",\n \"Dropdown 3\"\n ]\n },\n {\n \"title\": \"ratingQn\",\n \"type\": \"rating\",\n \"minLabel\": \"Strongly Disagree\",\n \"maxLabel\": \"Strongly Agree\",\n \"maxValue\": 10\n }\n ]\n },\n {\n \"questions\": [\n {\n \"title\": \"P3-Q1-Radio\",\n \"type\": \"radio\",\n \"choices\": [\n \"radio 1\",\n \"radio 2\",\n \"radio 3\"\n ]\n },\n {\n \"title\": \"npsQn\",\n \"type\": \"nps\",\n \"minLabel\": \"Strongly Disagree\"\n }\n ]\n },\n {\n \"questions\": [\n {\n \"title\": \"Datetime question\",\n \"type\": \"datetime\",\n \"required\": true,\n \"showTime\": true,\n \"showDate\": true,\n \"interval\": 60,\n \"minValue\": \"12\",\n \"maxValue\": \"36\"\n },\n {\n \"title\": \"Please enter your contact information\",\n \"type\": \"contact\",\n \"required\": true,\n \"contactRows\": [\n {\n \"required\": true,\n \"title\": \"First name\",\n \"type\": \"text\"\n },\n {\n \"required\": true,\n \"title\": \"Email\",\n \"type\": \"email\"\n },\n {\n \"required\": true,\n \"title\": \"Phone\",\n \"type\": \"phone\"\n }\n ]\n }\n ]\n },\n {\n \"title\": \"Page 4\",\n \"questions\": [\n {\n \"title\": \"P4-Q1\",\n \"type\": \"matrixrating\",\n \"minLabel\": \"Strongly Disagree\",\n \"maxLabel\": \"Strongly Agree\",\n \"maxValue\": 5,\n \"rows\": [\n \"Row label 1\",\n \"Row label 2\"\n ]\n },\n {\n \"title\": \"P4-Q2\",\n \"type\": \"matrixradio\",\n \"required\": true,\n \"choices\": [\n \"c1\",\n \"c2\",\n \"c3\"\n ],\n \"rows\": [\n \"Row 1\",\n \"Row2\"\n ]\n },\n {\n \"title\": \"p4-Q3\",\n \"type\": \"matrixdropdown\",\n \"required\": true,\n \"choices\": [\n \"c1\",\n \"c2\",\n \"c3\"\n ],\n \"rows\": [\n \"Row label 1\",\n \"Row label 2\"\n ]\n },\n {\n \"title\": \"Label type ques\",\n \"type\": \"label\"\n }\n ]\n },\n {\n \"questions\": [\n {\n \"title\": \"please review us on one of these sites\",\n \"type\": \"review\",\n \"required\": true,\n \"contactUsMessage\": \"ContactUs test message\",\n \"reviewSources\": [\n \"Google\",\n \"Facebook\",\n \"CitySearch\"\n ]\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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.birdeye.com/resources/v1/survey/external/create/{businessId}")
.header("Content-Type", "application/json")
.body("{\n \"surveyName\": \"Experience Survey\",\n \"thankYouMessage\": \"Thank you for taking the survey!\",\n \"surveyType\": \"traditional\",\n \"ownerEmailId\": \"testmail@gmail.com\",\n \"pages\": [\n {\n \"questions\": [\n {\n \"title\": \"Text1\",\n \"type\": \"text\"\n },\n {\n \"title\": \"Paragraph\",\n \"type\": \"textarea\"\n }\n ]\n },\n {\n \"title\": \"Page 2-optional\",\n \"questions\": [\n {\n \"title\": \"Questionnumber1\",\n \"type\": \"checkbox\",\n \"required\": true,\n \"choices\": [\n \"Choice 1\",\n \"Choice 2\",\n \"Choice 3\"\n ]\n },\n {\n \"title\": \"Q2\",\n \"type\": \"dropdown\",\n \"choices\": [\n \"Dropdown 1\",\n \"Dropdown 2\",\n \"Dropdown 3\"\n ]\n },\n {\n \"title\": \"ratingQn\",\n \"type\": \"rating\",\n \"minLabel\": \"Strongly Disagree\",\n \"maxLabel\": \"Strongly Agree\",\n \"maxValue\": 10\n }\n ]\n },\n {\n \"questions\": [\n {\n \"title\": \"P3-Q1-Radio\",\n \"type\": \"radio\",\n \"choices\": [\n \"radio 1\",\n \"radio 2\",\n \"radio 3\"\n ]\n },\n {\n \"title\": \"npsQn\",\n \"type\": \"nps\",\n \"minLabel\": \"Strongly Disagree\"\n }\n ]\n },\n {\n \"questions\": [\n {\n \"title\": \"Datetime question\",\n \"type\": \"datetime\",\n \"required\": true,\n \"showTime\": true,\n \"showDate\": true,\n \"interval\": 60,\n \"minValue\": \"12\",\n \"maxValue\": \"36\"\n },\n {\n \"title\": \"Please enter your contact information\",\n \"type\": \"contact\",\n \"required\": true,\n \"contactRows\": [\n {\n \"required\": true,\n \"title\": \"First name\",\n \"type\": \"text\"\n },\n {\n \"required\": true,\n \"title\": \"Email\",\n \"type\": \"email\"\n },\n {\n \"required\": true,\n \"title\": \"Phone\",\n \"type\": \"phone\"\n }\n ]\n }\n ]\n },\n {\n \"title\": \"Page 4\",\n \"questions\": [\n {\n \"title\": \"P4-Q1\",\n \"type\": \"matrixrating\",\n \"minLabel\": \"Strongly Disagree\",\n \"maxLabel\": \"Strongly Agree\",\n \"maxValue\": 5,\n \"rows\": [\n \"Row label 1\",\n \"Row label 2\"\n ]\n },\n {\n \"title\": \"P4-Q2\",\n \"type\": \"matrixradio\",\n \"required\": true,\n \"choices\": [\n \"c1\",\n \"c2\",\n \"c3\"\n ],\n \"rows\": [\n \"Row 1\",\n \"Row2\"\n ]\n },\n {\n \"title\": \"p4-Q3\",\n \"type\": \"matrixdropdown\",\n \"required\": true,\n \"choices\": [\n \"c1\",\n \"c2\",\n \"c3\"\n ],\n \"rows\": [\n \"Row label 1\",\n \"Row label 2\"\n ]\n },\n {\n \"title\": \"Label type ques\",\n \"type\": \"label\"\n }\n ]\n },\n {\n \"questions\": [\n {\n \"title\": \"please review us on one of these sites\",\n \"type\": \"review\",\n \"required\": true,\n \"contactUsMessage\": \"ContactUs test message\",\n \"reviewSources\": [\n \"Google\",\n \"Facebook\",\n \"CitySearch\"\n ]\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.birdeye.com/resources/v1/survey/external/create/{businessId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"surveyName\": \"Experience Survey\",\n \"thankYouMessage\": \"Thank you for taking the survey!\",\n \"surveyType\": \"traditional\",\n \"ownerEmailId\": \"testmail@gmail.com\",\n \"pages\": [\n {\n \"questions\": [\n {\n \"title\": \"Text1\",\n \"type\": \"text\"\n },\n {\n \"title\": \"Paragraph\",\n \"type\": \"textarea\"\n }\n ]\n },\n {\n \"title\": \"Page 2-optional\",\n \"questions\": [\n {\n \"title\": \"Questionnumber1\",\n \"type\": \"checkbox\",\n \"required\": true,\n \"choices\": [\n \"Choice 1\",\n \"Choice 2\",\n \"Choice 3\"\n ]\n },\n {\n \"title\": \"Q2\",\n \"type\": \"dropdown\",\n \"choices\": [\n \"Dropdown 1\",\n \"Dropdown 2\",\n \"Dropdown 3\"\n ]\n },\n {\n \"title\": \"ratingQn\",\n \"type\": \"rating\",\n \"minLabel\": \"Strongly Disagree\",\n \"maxLabel\": \"Strongly Agree\",\n \"maxValue\": 10\n }\n ]\n },\n {\n \"questions\": [\n {\n \"title\": \"P3-Q1-Radio\",\n \"type\": \"radio\",\n \"choices\": [\n \"radio 1\",\n \"radio 2\",\n \"radio 3\"\n ]\n },\n {\n \"title\": \"npsQn\",\n \"type\": \"nps\",\n \"minLabel\": \"Strongly Disagree\"\n }\n ]\n },\n {\n \"questions\": [\n {\n \"title\": \"Datetime question\",\n \"type\": \"datetime\",\n \"required\": true,\n \"showTime\": true,\n \"showDate\": true,\n \"interval\": 60,\n \"minValue\": \"12\",\n \"maxValue\": \"36\"\n },\n {\n \"title\": \"Please enter your contact information\",\n \"type\": \"contact\",\n \"required\": true,\n \"contactRows\": [\n {\n \"required\": true,\n \"title\": \"First name\",\n \"type\": \"text\"\n },\n {\n \"required\": true,\n \"title\": \"Email\",\n \"type\": \"email\"\n },\n {\n \"required\": true,\n \"title\": \"Phone\",\n \"type\": \"phone\"\n }\n ]\n }\n ]\n },\n {\n \"title\": \"Page 4\",\n \"questions\": [\n {\n \"title\": \"P4-Q1\",\n \"type\": \"matrixrating\",\n \"minLabel\": \"Strongly Disagree\",\n \"maxLabel\": \"Strongly Agree\",\n \"maxValue\": 5,\n \"rows\": [\n \"Row label 1\",\n \"Row label 2\"\n ]\n },\n {\n \"title\": \"P4-Q2\",\n \"type\": \"matrixradio\",\n \"required\": true,\n \"choices\": [\n \"c1\",\n \"c2\",\n \"c3\"\n ],\n \"rows\": [\n \"Row 1\",\n \"Row2\"\n ]\n },\n {\n \"title\": \"p4-Q3\",\n \"type\": \"matrixdropdown\",\n \"required\": true,\n \"choices\": [\n \"c1\",\n \"c2\",\n \"c3\"\n ],\n \"rows\": [\n \"Row label 1\",\n \"Row label 2\"\n ]\n },\n {\n \"title\": \"Label type ques\",\n \"type\": \"label\"\n }\n ]\n },\n {\n \"questions\": [\n {\n \"title\": \"please review us on one of these sites\",\n \"type\": \"review\",\n \"required\": true,\n \"contactUsMessage\": \"ContactUs test message\",\n \"reviewSources\": [\n \"Google\",\n \"Facebook\",\n \"CitySearch\"\n ]\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"surveyId": 1234
}{
"code": 2044,
"message": "Survey already completed"
}{
"code": 1161,
"message": "Invalid API key"
}{
"code": 1011,
"message": "Business id is invalid"
}{
"code": 89,
"message": "Rate limit exceeded"
}Survey
Create Survey
Create Survey API helps create a new survey for the required question structure and further displays it on the survey list page.
Please go through this document for a detailed explanation of request body fieldsPOST
/
v1
/
survey
/
external
/
create
/
{businessId}
Create Survey
curl --request POST \
--url https://api.birdeye.com/resources/v1/survey/external/create/{businessId} \
--header 'Content-Type: application/json' \
--data '
{
"surveyName": "Experience Survey",
"thankYouMessage": "Thank you for taking the survey!",
"surveyType": "traditional",
"ownerEmailId": "testmail@gmail.com",
"pages": [
{
"questions": [
{
"title": "Text1",
"type": "text"
},
{
"title": "Paragraph",
"type": "textarea"
}
]
},
{
"title": "Page 2-optional",
"questions": [
{
"title": "Questionnumber1",
"type": "checkbox",
"required": true,
"choices": [
"Choice 1",
"Choice 2",
"Choice 3"
]
},
{
"title": "Q2",
"type": "dropdown",
"choices": [
"Dropdown 1",
"Dropdown 2",
"Dropdown 3"
]
},
{
"title": "ratingQn",
"type": "rating",
"minLabel": "Strongly Disagree",
"maxLabel": "Strongly Agree",
"maxValue": 10
}
]
},
{
"questions": [
{
"title": "P3-Q1-Radio",
"type": "radio",
"choices": [
"radio 1",
"radio 2",
"radio 3"
]
},
{
"title": "npsQn",
"type": "nps",
"minLabel": "Strongly Disagree"
}
]
},
{
"questions": [
{
"title": "Datetime question",
"type": "datetime",
"required": true,
"showTime": true,
"showDate": true,
"interval": 60,
"minValue": "12",
"maxValue": "36"
},
{
"title": "Please enter your contact information",
"type": "contact",
"required": true,
"contactRows": [
{
"required": true,
"title": "First name",
"type": "text"
},
{
"required": true,
"title": "Email",
"type": "email"
},
{
"required": true,
"title": "Phone",
"type": "phone"
}
]
}
]
},
{
"title": "Page 4",
"questions": [
{
"title": "P4-Q1",
"type": "matrixrating",
"minLabel": "Strongly Disagree",
"maxLabel": "Strongly Agree",
"maxValue": 5,
"rows": [
"Row label 1",
"Row label 2"
]
},
{
"title": "P4-Q2",
"type": "matrixradio",
"required": true,
"choices": [
"c1",
"c2",
"c3"
],
"rows": [
"Row 1",
"Row2"
]
},
{
"title": "p4-Q3",
"type": "matrixdropdown",
"required": true,
"choices": [
"c1",
"c2",
"c3"
],
"rows": [
"Row label 1",
"Row label 2"
]
},
{
"title": "Label type ques",
"type": "label"
}
]
},
{
"questions": [
{
"title": "please review us on one of these sites",
"type": "review",
"required": true,
"contactUsMessage": "ContactUs test message",
"reviewSources": [
"Google",
"Facebook",
"CitySearch"
]
}
]
}
]
}
'import requests
url = "https://api.birdeye.com/resources/v1/survey/external/create/{businessId}"
payload = {
"surveyName": "Experience Survey",
"thankYouMessage": "Thank you for taking the survey!",
"surveyType": "traditional",
"ownerEmailId": "testmail@gmail.com",
"pages": [{ "questions": [
{
"title": "Text1",
"type": "text"
},
{
"title": "Paragraph",
"type": "textarea"
}
] }, {
"title": "Page 2-optional",
"questions": [
{
"title": "Questionnumber1",
"type": "checkbox",
"required": True,
"choices": ["Choice 1", "Choice 2", "Choice 3"]
},
{
"title": "Q2",
"type": "dropdown",
"choices": ["Dropdown 1", "Dropdown 2", "Dropdown 3"]
},
{
"title": "ratingQn",
"type": "rating",
"minLabel": "Strongly Disagree",
"maxLabel": "Strongly Agree",
"maxValue": 10
}
]
}, { "questions": [
{
"title": "P3-Q1-Radio",
"type": "radio",
"choices": ["radio 1", "radio 2", "radio 3"]
},
{
"title": "npsQn",
"type": "nps",
"minLabel": "Strongly Disagree"
}
] }, { "questions": [
{
"title": "Datetime question",
"type": "datetime",
"required": True,
"showTime": True,
"showDate": True,
"interval": 60,
"minValue": "12",
"maxValue": "36"
},
{
"title": "Please enter your contact information",
"type": "contact",
"required": True,
"contactRows": [
{
"required": True,
"title": "First name",
"type": "text"
},
{
"required": True,
"title": "Email",
"type": "email"
},
{
"required": True,
"title": "Phone",
"type": "phone"
}
]
}
] }, {
"title": "Page 4",
"questions": [
{
"title": "P4-Q1",
"type": "matrixrating",
"minLabel": "Strongly Disagree",
"maxLabel": "Strongly Agree",
"maxValue": 5,
"rows": ["Row label 1", "Row label 2"]
},
{
"title": "P4-Q2",
"type": "matrixradio",
"required": True,
"choices": ["c1", "c2", "c3"],
"rows": ["Row 1", "Row2"]
},
{
"title": "p4-Q3",
"type": "matrixdropdown",
"required": True,
"choices": ["c1", "c2", "c3"],
"rows": ["Row label 1", "Row label 2"]
},
{
"title": "Label type ques",
"type": "label"
}
]
}, { "questions": [
{
"title": "please review us on one of these sites",
"type": "review",
"required": True,
"contactUsMessage": "ContactUs test message",
"reviewSources": ["Google", "Facebook", "CitySearch"]
}
] }]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
surveyName: 'Experience Survey',
thankYouMessage: 'Thank you for taking the survey!',
surveyType: 'traditional',
ownerEmailId: 'testmail@gmail.com',
pages: [
{
questions: [{title: 'Text1', type: 'text'}, {title: 'Paragraph', type: 'textarea'}]
},
{
title: 'Page 2-optional',
questions: [
{
title: 'Questionnumber1',
type: 'checkbox',
required: true,
choices: ['Choice 1', 'Choice 2', 'Choice 3']
},
{
title: 'Q2',
type: 'dropdown',
choices: ['Dropdown 1', 'Dropdown 2', 'Dropdown 3']
},
{
title: 'ratingQn',
type: 'rating',
minLabel: 'Strongly Disagree',
maxLabel: 'Strongly Agree',
maxValue: 10
}
]
},
{
questions: [
{
title: 'P3-Q1-Radio',
type: 'radio',
choices: ['radio 1', 'radio 2', 'radio 3']
},
{title: 'npsQn', type: 'nps', minLabel: 'Strongly Disagree'}
]
},
{
questions: [
{
title: 'Datetime question',
type: 'datetime',
required: true,
showTime: true,
showDate: true,
interval: 60,
minValue: '12',
maxValue: '36'
},
{
title: 'Please enter your contact information',
type: 'contact',
required: true,
contactRows: [
{required: true, title: 'First name', type: 'text'},
{required: true, title: 'Email', type: 'email'},
{required: true, title: 'Phone', type: 'phone'}
]
}
]
},
{
title: 'Page 4',
questions: [
{
title: 'P4-Q1',
type: 'matrixrating',
minLabel: 'Strongly Disagree',
maxLabel: 'Strongly Agree',
maxValue: 5,
rows: ['Row label 1', 'Row label 2']
},
{
title: 'P4-Q2',
type: 'matrixradio',
required: true,
choices: ['c1', 'c2', 'c3'],
rows: ['Row 1', 'Row2']
},
{
title: 'p4-Q3',
type: 'matrixdropdown',
required: true,
choices: ['c1', 'c2', 'c3'],
rows: ['Row label 1', 'Row label 2']
},
{title: 'Label type ques', type: 'label'}
]
},
{
questions: [
{
title: 'please review us on one of these sites',
type: 'review',
required: true,
contactUsMessage: 'ContactUs test message',
reviewSources: ['Google', 'Facebook', 'CitySearch']
}
]
}
]
})
};
fetch('https://api.birdeye.com/resources/v1/survey/external/create/{businessId}', 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.birdeye.com/resources/v1/survey/external/create/{businessId}",
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([
'surveyName' => 'Experience Survey',
'thankYouMessage' => 'Thank you for taking the survey!',
'surveyType' => 'traditional',
'ownerEmailId' => 'testmail@gmail.com',
'pages' => [
[
'questions' => [
[
'title' => 'Text1',
'type' => 'text'
],
[
'title' => 'Paragraph',
'type' => 'textarea'
]
]
],
[
'title' => 'Page 2-optional',
'questions' => [
[
'title' => 'Questionnumber1',
'type' => 'checkbox',
'required' => true,
'choices' => [
'Choice 1',
'Choice 2',
'Choice 3'
]
],
[
'title' => 'Q2',
'type' => 'dropdown',
'choices' => [
'Dropdown 1',
'Dropdown 2',
'Dropdown 3'
]
],
[
'title' => 'ratingQn',
'type' => 'rating',
'minLabel' => 'Strongly Disagree',
'maxLabel' => 'Strongly Agree',
'maxValue' => 10
]
]
],
[
'questions' => [
[
'title' => 'P3-Q1-Radio',
'type' => 'radio',
'choices' => [
'radio 1',
'radio 2',
'radio 3'
]
],
[
'title' => 'npsQn',
'type' => 'nps',
'minLabel' => 'Strongly Disagree'
]
]
],
[
'questions' => [
[
'title' => 'Datetime question',
'type' => 'datetime',
'required' => true,
'showTime' => true,
'showDate' => true,
'interval' => 60,
'minValue' => '12',
'maxValue' => '36'
],
[
'title' => 'Please enter your contact information',
'type' => 'contact',
'required' => true,
'contactRows' => [
[
'required' => true,
'title' => 'First name',
'type' => 'text'
],
[
'required' => true,
'title' => 'Email',
'type' => 'email'
],
[
'required' => true,
'title' => 'Phone',
'type' => 'phone'
]
]
]
]
],
[
'title' => 'Page 4',
'questions' => [
[
'title' => 'P4-Q1',
'type' => 'matrixrating',
'minLabel' => 'Strongly Disagree',
'maxLabel' => 'Strongly Agree',
'maxValue' => 5,
'rows' => [
'Row label 1',
'Row label 2'
]
],
[
'title' => 'P4-Q2',
'type' => 'matrixradio',
'required' => true,
'choices' => [
'c1',
'c2',
'c3'
],
'rows' => [
'Row 1',
'Row2'
]
],
[
'title' => 'p4-Q3',
'type' => 'matrixdropdown',
'required' => true,
'choices' => [
'c1',
'c2',
'c3'
],
'rows' => [
'Row label 1',
'Row label 2'
]
],
[
'title' => 'Label type ques',
'type' => 'label'
]
]
],
[
'questions' => [
[
'title' => 'please review us on one of these sites',
'type' => 'review',
'required' => true,
'contactUsMessage' => 'ContactUs test message',
'reviewSources' => [
'Google',
'Facebook',
'CitySearch'
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"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.birdeye.com/resources/v1/survey/external/create/{businessId}"
payload := strings.NewReader("{\n \"surveyName\": \"Experience Survey\",\n \"thankYouMessage\": \"Thank you for taking the survey!\",\n \"surveyType\": \"traditional\",\n \"ownerEmailId\": \"testmail@gmail.com\",\n \"pages\": [\n {\n \"questions\": [\n {\n \"title\": \"Text1\",\n \"type\": \"text\"\n },\n {\n \"title\": \"Paragraph\",\n \"type\": \"textarea\"\n }\n ]\n },\n {\n \"title\": \"Page 2-optional\",\n \"questions\": [\n {\n \"title\": \"Questionnumber1\",\n \"type\": \"checkbox\",\n \"required\": true,\n \"choices\": [\n \"Choice 1\",\n \"Choice 2\",\n \"Choice 3\"\n ]\n },\n {\n \"title\": \"Q2\",\n \"type\": \"dropdown\",\n \"choices\": [\n \"Dropdown 1\",\n \"Dropdown 2\",\n \"Dropdown 3\"\n ]\n },\n {\n \"title\": \"ratingQn\",\n \"type\": \"rating\",\n \"minLabel\": \"Strongly Disagree\",\n \"maxLabel\": \"Strongly Agree\",\n \"maxValue\": 10\n }\n ]\n },\n {\n \"questions\": [\n {\n \"title\": \"P3-Q1-Radio\",\n \"type\": \"radio\",\n \"choices\": [\n \"radio 1\",\n \"radio 2\",\n \"radio 3\"\n ]\n },\n {\n \"title\": \"npsQn\",\n \"type\": \"nps\",\n \"minLabel\": \"Strongly Disagree\"\n }\n ]\n },\n {\n \"questions\": [\n {\n \"title\": \"Datetime question\",\n \"type\": \"datetime\",\n \"required\": true,\n \"showTime\": true,\n \"showDate\": true,\n \"interval\": 60,\n \"minValue\": \"12\",\n \"maxValue\": \"36\"\n },\n {\n \"title\": \"Please enter your contact information\",\n \"type\": \"contact\",\n \"required\": true,\n \"contactRows\": [\n {\n \"required\": true,\n \"title\": \"First name\",\n \"type\": \"text\"\n },\n {\n \"required\": true,\n \"title\": \"Email\",\n \"type\": \"email\"\n },\n {\n \"required\": true,\n \"title\": \"Phone\",\n \"type\": \"phone\"\n }\n ]\n }\n ]\n },\n {\n \"title\": \"Page 4\",\n \"questions\": [\n {\n \"title\": \"P4-Q1\",\n \"type\": \"matrixrating\",\n \"minLabel\": \"Strongly Disagree\",\n \"maxLabel\": \"Strongly Agree\",\n \"maxValue\": 5,\n \"rows\": [\n \"Row label 1\",\n \"Row label 2\"\n ]\n },\n {\n \"title\": \"P4-Q2\",\n \"type\": \"matrixradio\",\n \"required\": true,\n \"choices\": [\n \"c1\",\n \"c2\",\n \"c3\"\n ],\n \"rows\": [\n \"Row 1\",\n \"Row2\"\n ]\n },\n {\n \"title\": \"p4-Q3\",\n \"type\": \"matrixdropdown\",\n \"required\": true,\n \"choices\": [\n \"c1\",\n \"c2\",\n \"c3\"\n ],\n \"rows\": [\n \"Row label 1\",\n \"Row label 2\"\n ]\n },\n {\n \"title\": \"Label type ques\",\n \"type\": \"label\"\n }\n ]\n },\n {\n \"questions\": [\n {\n \"title\": \"please review us on one of these sites\",\n \"type\": \"review\",\n \"required\": true,\n \"contactUsMessage\": \"ContactUs test message\",\n \"reviewSources\": [\n \"Google\",\n \"Facebook\",\n \"CitySearch\"\n ]\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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.birdeye.com/resources/v1/survey/external/create/{businessId}")
.header("Content-Type", "application/json")
.body("{\n \"surveyName\": \"Experience Survey\",\n \"thankYouMessage\": \"Thank you for taking the survey!\",\n \"surveyType\": \"traditional\",\n \"ownerEmailId\": \"testmail@gmail.com\",\n \"pages\": [\n {\n \"questions\": [\n {\n \"title\": \"Text1\",\n \"type\": \"text\"\n },\n {\n \"title\": \"Paragraph\",\n \"type\": \"textarea\"\n }\n ]\n },\n {\n \"title\": \"Page 2-optional\",\n \"questions\": [\n {\n \"title\": \"Questionnumber1\",\n \"type\": \"checkbox\",\n \"required\": true,\n \"choices\": [\n \"Choice 1\",\n \"Choice 2\",\n \"Choice 3\"\n ]\n },\n {\n \"title\": \"Q2\",\n \"type\": \"dropdown\",\n \"choices\": [\n \"Dropdown 1\",\n \"Dropdown 2\",\n \"Dropdown 3\"\n ]\n },\n {\n \"title\": \"ratingQn\",\n \"type\": \"rating\",\n \"minLabel\": \"Strongly Disagree\",\n \"maxLabel\": \"Strongly Agree\",\n \"maxValue\": 10\n }\n ]\n },\n {\n \"questions\": [\n {\n \"title\": \"P3-Q1-Radio\",\n \"type\": \"radio\",\n \"choices\": [\n \"radio 1\",\n \"radio 2\",\n \"radio 3\"\n ]\n },\n {\n \"title\": \"npsQn\",\n \"type\": \"nps\",\n \"minLabel\": \"Strongly Disagree\"\n }\n ]\n },\n {\n \"questions\": [\n {\n \"title\": \"Datetime question\",\n \"type\": \"datetime\",\n \"required\": true,\n \"showTime\": true,\n \"showDate\": true,\n \"interval\": 60,\n \"minValue\": \"12\",\n \"maxValue\": \"36\"\n },\n {\n \"title\": \"Please enter your contact information\",\n \"type\": \"contact\",\n \"required\": true,\n \"contactRows\": [\n {\n \"required\": true,\n \"title\": \"First name\",\n \"type\": \"text\"\n },\n {\n \"required\": true,\n \"title\": \"Email\",\n \"type\": \"email\"\n },\n {\n \"required\": true,\n \"title\": \"Phone\",\n \"type\": \"phone\"\n }\n ]\n }\n ]\n },\n {\n \"title\": \"Page 4\",\n \"questions\": [\n {\n \"title\": \"P4-Q1\",\n \"type\": \"matrixrating\",\n \"minLabel\": \"Strongly Disagree\",\n \"maxLabel\": \"Strongly Agree\",\n \"maxValue\": 5,\n \"rows\": [\n \"Row label 1\",\n \"Row label 2\"\n ]\n },\n {\n \"title\": \"P4-Q2\",\n \"type\": \"matrixradio\",\n \"required\": true,\n \"choices\": [\n \"c1\",\n \"c2\",\n \"c3\"\n ],\n \"rows\": [\n \"Row 1\",\n \"Row2\"\n ]\n },\n {\n \"title\": \"p4-Q3\",\n \"type\": \"matrixdropdown\",\n \"required\": true,\n \"choices\": [\n \"c1\",\n \"c2\",\n \"c3\"\n ],\n \"rows\": [\n \"Row label 1\",\n \"Row label 2\"\n ]\n },\n {\n \"title\": \"Label type ques\",\n \"type\": \"label\"\n }\n ]\n },\n {\n \"questions\": [\n {\n \"title\": \"please review us on one of these sites\",\n \"type\": \"review\",\n \"required\": true,\n \"contactUsMessage\": \"ContactUs test message\",\n \"reviewSources\": [\n \"Google\",\n \"Facebook\",\n \"CitySearch\"\n ]\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.birdeye.com/resources/v1/survey/external/create/{businessId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"surveyName\": \"Experience Survey\",\n \"thankYouMessage\": \"Thank you for taking the survey!\",\n \"surveyType\": \"traditional\",\n \"ownerEmailId\": \"testmail@gmail.com\",\n \"pages\": [\n {\n \"questions\": [\n {\n \"title\": \"Text1\",\n \"type\": \"text\"\n },\n {\n \"title\": \"Paragraph\",\n \"type\": \"textarea\"\n }\n ]\n },\n {\n \"title\": \"Page 2-optional\",\n \"questions\": [\n {\n \"title\": \"Questionnumber1\",\n \"type\": \"checkbox\",\n \"required\": true,\n \"choices\": [\n \"Choice 1\",\n \"Choice 2\",\n \"Choice 3\"\n ]\n },\n {\n \"title\": \"Q2\",\n \"type\": \"dropdown\",\n \"choices\": [\n \"Dropdown 1\",\n \"Dropdown 2\",\n \"Dropdown 3\"\n ]\n },\n {\n \"title\": \"ratingQn\",\n \"type\": \"rating\",\n \"minLabel\": \"Strongly Disagree\",\n \"maxLabel\": \"Strongly Agree\",\n \"maxValue\": 10\n }\n ]\n },\n {\n \"questions\": [\n {\n \"title\": \"P3-Q1-Radio\",\n \"type\": \"radio\",\n \"choices\": [\n \"radio 1\",\n \"radio 2\",\n \"radio 3\"\n ]\n },\n {\n \"title\": \"npsQn\",\n \"type\": \"nps\",\n \"minLabel\": \"Strongly Disagree\"\n }\n ]\n },\n {\n \"questions\": [\n {\n \"title\": \"Datetime question\",\n \"type\": \"datetime\",\n \"required\": true,\n \"showTime\": true,\n \"showDate\": true,\n \"interval\": 60,\n \"minValue\": \"12\",\n \"maxValue\": \"36\"\n },\n {\n \"title\": \"Please enter your contact information\",\n \"type\": \"contact\",\n \"required\": true,\n \"contactRows\": [\n {\n \"required\": true,\n \"title\": \"First name\",\n \"type\": \"text\"\n },\n {\n \"required\": true,\n \"title\": \"Email\",\n \"type\": \"email\"\n },\n {\n \"required\": true,\n \"title\": \"Phone\",\n \"type\": \"phone\"\n }\n ]\n }\n ]\n },\n {\n \"title\": \"Page 4\",\n \"questions\": [\n {\n \"title\": \"P4-Q1\",\n \"type\": \"matrixrating\",\n \"minLabel\": \"Strongly Disagree\",\n \"maxLabel\": \"Strongly Agree\",\n \"maxValue\": 5,\n \"rows\": [\n \"Row label 1\",\n \"Row label 2\"\n ]\n },\n {\n \"title\": \"P4-Q2\",\n \"type\": \"matrixradio\",\n \"required\": true,\n \"choices\": [\n \"c1\",\n \"c2\",\n \"c3\"\n ],\n \"rows\": [\n \"Row 1\",\n \"Row2\"\n ]\n },\n {\n \"title\": \"p4-Q3\",\n \"type\": \"matrixdropdown\",\n \"required\": true,\n \"choices\": [\n \"c1\",\n \"c2\",\n \"c3\"\n ],\n \"rows\": [\n \"Row label 1\",\n \"Row label 2\"\n ]\n },\n {\n \"title\": \"Label type ques\",\n \"type\": \"label\"\n }\n ]\n },\n {\n \"questions\": [\n {\n \"title\": \"please review us on one of these sites\",\n \"type\": \"review\",\n \"required\": true,\n \"contactUsMessage\": \"ContactUs test message\",\n \"reviewSources\": [\n \"Google\",\n \"Facebook\",\n \"CitySearch\"\n ]\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"surveyId": 1234
}{
"code": 2044,
"message": "Survey already completed"
}{
"code": 1161,
"message": "Invalid API key"
}{
"code": 1011,
"message": "Business id is invalid"
}{
"code": 89,
"message": "Rate limit exceeded"
}Headers
e.g. application/json
e.g. [Required] Partner specific API key provided by Birdeye for data exchange.
Media type of the JSON request body.
Path Parameters
Id of the Business.
Body
application/json
Response
OK
⌘I