cURL
curl --request POST \
--url https://app.masivo.ai/api/storefront/v1/review-forms \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Post trip rating",
"description": "Post-trip satisfaction survey",
"type": "RATING",
"fields": [
{
"name": "score",
"label": "Rating",
"type": "SCORE",
"required": true,
"min": 1,
"max": 5
},
{
"name": "reason",
"label": "What went wrong?",
"type": "MULTI_SELECT",
"required": false,
"options": [
{
"label": "Wait time",
"value": "wait_time"
},
{
"label": "Service",
"value": "service",
"requires_comment": true
}
]
},
{
"name": "comment",
"label": "Comment",
"type": "TEXT",
"required": false
}
],
"settings": {
"ticket_automation": {
"enabled": true,
"pipeline_id": "550e8400-e29b-41d4-a716-446655440000",
"priority": "high",
"trigger": "conditions",
"conditions": [
[
{
"primitive": "custom",
"type": "Response answer",
"reporting_period": "MONTHLY",
"field": "score",
"operator": "less than",
"value": "3"
}
]
]
}
}
}
'import requests
url = "https://app.masivo.ai/api/storefront/v1/review-forms"
payload = {
"name": "Post trip rating",
"description": "Post-trip satisfaction survey",
"type": "RATING",
"fields": [
{
"name": "score",
"label": "Rating",
"type": "SCORE",
"required": True,
"min": 1,
"max": 5
},
{
"name": "reason",
"label": "What went wrong?",
"type": "MULTI_SELECT",
"required": False,
"options": [
{
"label": "Wait time",
"value": "wait_time"
},
{
"label": "Service",
"value": "service",
"requires_comment": True
}
]
},
{
"name": "comment",
"label": "Comment",
"type": "TEXT",
"required": False
}
],
"settings": { "ticket_automation": {
"enabled": True,
"pipeline_id": "550e8400-e29b-41d4-a716-446655440000",
"priority": "high",
"trigger": "conditions",
"conditions": [[
{
"primitive": "custom",
"type": "Response answer",
"reporting_period": "MONTHLY",
"field": "score",
"operator": "less than",
"value": "3"
}
]]
} }
}
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({
name: 'Post trip rating',
description: 'Post-trip satisfaction survey',
type: 'RATING',
fields: [
{name: 'score', label: 'Rating', type: 'SCORE', required: true, min: 1, max: 5},
{
name: 'reason',
label: 'What went wrong?',
type: 'MULTI_SELECT',
required: false,
options: [
{label: 'Wait time', value: 'wait_time'},
{label: 'Service', value: 'service', requires_comment: true}
]
},
{name: 'comment', label: 'Comment', type: 'TEXT', required: false}
],
settings: {
ticket_automation: {
enabled: true,
pipeline_id: '550e8400-e29b-41d4-a716-446655440000',
priority: 'high',
trigger: 'conditions',
conditions: [
[
{
primitive: 'custom',
type: 'Response answer',
reporting_period: 'MONTHLY',
field: 'score',
operator: 'less than',
value: '3'
}
]
]
}
}
})
};
fetch('https://app.masivo.ai/api/storefront/v1/review-forms', 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://app.masivo.ai/api/storefront/v1/review-forms",
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([
'name' => 'Post trip rating',
'description' => 'Post-trip satisfaction survey',
'type' => 'RATING',
'fields' => [
[
'name' => 'score',
'label' => 'Rating',
'type' => 'SCORE',
'required' => true,
'min' => 1,
'max' => 5
],
[
'name' => 'reason',
'label' => 'What went wrong?',
'type' => 'MULTI_SELECT',
'required' => false,
'options' => [
[
'label' => 'Wait time',
'value' => 'wait_time'
],
[
'label' => 'Service',
'value' => 'service',
'requires_comment' => true
]
]
],
[
'name' => 'comment',
'label' => 'Comment',
'type' => 'TEXT',
'required' => false
]
],
'settings' => [
'ticket_automation' => [
'enabled' => true,
'pipeline_id' => '550e8400-e29b-41d4-a716-446655440000',
'priority' => 'high',
'trigger' => 'conditions',
'conditions' => [
[
[
'primitive' => 'custom',
'type' => 'Response answer',
'reporting_period' => 'MONTHLY',
'field' => 'score',
'operator' => 'less than',
'value' => '3'
]
]
]
]
]
]),
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://app.masivo.ai/api/storefront/v1/review-forms"
payload := strings.NewReader("{\n \"name\": \"Post trip rating\",\n \"description\": \"Post-trip satisfaction survey\",\n \"type\": \"RATING\",\n \"fields\": [\n {\n \"name\": \"score\",\n \"label\": \"Rating\",\n \"type\": \"SCORE\",\n \"required\": true,\n \"min\": 1,\n \"max\": 5\n },\n {\n \"name\": \"reason\",\n \"label\": \"What went wrong?\",\n \"type\": \"MULTI_SELECT\",\n \"required\": false,\n \"options\": [\n {\n \"label\": \"Wait time\",\n \"value\": \"wait_time\"\n },\n {\n \"label\": \"Service\",\n \"value\": \"service\",\n \"requires_comment\": true\n }\n ]\n },\n {\n \"name\": \"comment\",\n \"label\": \"Comment\",\n \"type\": \"TEXT\",\n \"required\": false\n }\n ],\n \"settings\": {\n \"ticket_automation\": {\n \"enabled\": true,\n \"pipeline_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"priority\": \"high\",\n \"trigger\": \"conditions\",\n \"conditions\": [\n [\n {\n \"primitive\": \"custom\",\n \"type\": \"Response answer\",\n \"reporting_period\": \"MONTHLY\",\n \"field\": \"score\",\n \"operator\": \"less than\",\n \"value\": \"3\"\n }\n ]\n ]\n }\n }\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://app.masivo.ai/api/storefront/v1/review-forms")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Post trip rating\",\n \"description\": \"Post-trip satisfaction survey\",\n \"type\": \"RATING\",\n \"fields\": [\n {\n \"name\": \"score\",\n \"label\": \"Rating\",\n \"type\": \"SCORE\",\n \"required\": true,\n \"min\": 1,\n \"max\": 5\n },\n {\n \"name\": \"reason\",\n \"label\": \"What went wrong?\",\n \"type\": \"MULTI_SELECT\",\n \"required\": false,\n \"options\": [\n {\n \"label\": \"Wait time\",\n \"value\": \"wait_time\"\n },\n {\n \"label\": \"Service\",\n \"value\": \"service\",\n \"requires_comment\": true\n }\n ]\n },\n {\n \"name\": \"comment\",\n \"label\": \"Comment\",\n \"type\": \"TEXT\",\n \"required\": false\n }\n ],\n \"settings\": {\n \"ticket_automation\": {\n \"enabled\": true,\n \"pipeline_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"priority\": \"high\",\n \"trigger\": \"conditions\",\n \"conditions\": [\n [\n {\n \"primitive\": \"custom\",\n \"type\": \"Response answer\",\n \"reporting_period\": \"MONTHLY\",\n \"field\": \"score\",\n \"operator\": \"less than\",\n \"value\": \"3\"\n }\n ]\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.masivo.ai/api/storefront/v1/review-forms")
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 \"name\": \"Post trip rating\",\n \"description\": \"Post-trip satisfaction survey\",\n \"type\": \"RATING\",\n \"fields\": [\n {\n \"name\": \"score\",\n \"label\": \"Rating\",\n \"type\": \"SCORE\",\n \"required\": true,\n \"min\": 1,\n \"max\": 5\n },\n {\n \"name\": \"reason\",\n \"label\": \"What went wrong?\",\n \"type\": \"MULTI_SELECT\",\n \"required\": false,\n \"options\": [\n {\n \"label\": \"Wait time\",\n \"value\": \"wait_time\"\n },\n {\n \"label\": \"Service\",\n \"value\": \"service\",\n \"requires_comment\": true\n }\n ]\n },\n {\n \"name\": \"comment\",\n \"label\": \"Comment\",\n \"type\": \"TEXT\",\n \"required\": false\n }\n ],\n \"settings\": {\n \"ticket_automation\": {\n \"enabled\": true,\n \"pipeline_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"priority\": \"high\",\n \"trigger\": \"conditions\",\n \"conditions\": [\n [\n {\n \"primitive\": \"custom\",\n \"type\": \"Response answer\",\n \"reporting_period\": \"MONTHLY\",\n \"field\": \"score\",\n \"operator\": \"less than\",\n \"value\": \"3\"\n }\n ]\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "RATING",
"status": "ACTIVE",
"fields": [
{
"name": "score",
"label": "Rating",
"type": "SCORE",
"required": true,
"options": [
{
"label": "Wait time",
"value": "wait_time"
}
],
"images": [
{
"url": "<string>",
"alt": "Store front"
}
],
"min": 1,
"max": 5
}
],
"settings": {
"ticket_automation": {
"enabled": false,
"pipeline_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"priority": "medium",
"trigger": "always",
"conditions": [
[
{
"primitive": "custom",
"type": "Response answer",
"reporting_period": "MONTHLY",
"operator": "is",
"value": "<string>",
"field": "<string>"
}
]
]
}
},
"description": "<string>"
}
}{
"error": "<string>",
"details": "<string>"
}{
"error": "<string>",
"details": "<unknown>"
}Review forms
Create form
Create a service form. Requires a SERVER API key. The form is created with source INTERNAL and becomes available through GET /review-forms/ when its status is ACTIVE. Field and ticket automation rules match the dashboard editor.
POST
/
review-forms
cURL
curl --request POST \
--url https://app.masivo.ai/api/storefront/v1/review-forms \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Post trip rating",
"description": "Post-trip satisfaction survey",
"type": "RATING",
"fields": [
{
"name": "score",
"label": "Rating",
"type": "SCORE",
"required": true,
"min": 1,
"max": 5
},
{
"name": "reason",
"label": "What went wrong?",
"type": "MULTI_SELECT",
"required": false,
"options": [
{
"label": "Wait time",
"value": "wait_time"
},
{
"label": "Service",
"value": "service",
"requires_comment": true
}
]
},
{
"name": "comment",
"label": "Comment",
"type": "TEXT",
"required": false
}
],
"settings": {
"ticket_automation": {
"enabled": true,
"pipeline_id": "550e8400-e29b-41d4-a716-446655440000",
"priority": "high",
"trigger": "conditions",
"conditions": [
[
{
"primitive": "custom",
"type": "Response answer",
"reporting_period": "MONTHLY",
"field": "score",
"operator": "less than",
"value": "3"
}
]
]
}
}
}
'import requests
url = "https://app.masivo.ai/api/storefront/v1/review-forms"
payload = {
"name": "Post trip rating",
"description": "Post-trip satisfaction survey",
"type": "RATING",
"fields": [
{
"name": "score",
"label": "Rating",
"type": "SCORE",
"required": True,
"min": 1,
"max": 5
},
{
"name": "reason",
"label": "What went wrong?",
"type": "MULTI_SELECT",
"required": False,
"options": [
{
"label": "Wait time",
"value": "wait_time"
},
{
"label": "Service",
"value": "service",
"requires_comment": True
}
]
},
{
"name": "comment",
"label": "Comment",
"type": "TEXT",
"required": False
}
],
"settings": { "ticket_automation": {
"enabled": True,
"pipeline_id": "550e8400-e29b-41d4-a716-446655440000",
"priority": "high",
"trigger": "conditions",
"conditions": [[
{
"primitive": "custom",
"type": "Response answer",
"reporting_period": "MONTHLY",
"field": "score",
"operator": "less than",
"value": "3"
}
]]
} }
}
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({
name: 'Post trip rating',
description: 'Post-trip satisfaction survey',
type: 'RATING',
fields: [
{name: 'score', label: 'Rating', type: 'SCORE', required: true, min: 1, max: 5},
{
name: 'reason',
label: 'What went wrong?',
type: 'MULTI_SELECT',
required: false,
options: [
{label: 'Wait time', value: 'wait_time'},
{label: 'Service', value: 'service', requires_comment: true}
]
},
{name: 'comment', label: 'Comment', type: 'TEXT', required: false}
],
settings: {
ticket_automation: {
enabled: true,
pipeline_id: '550e8400-e29b-41d4-a716-446655440000',
priority: 'high',
trigger: 'conditions',
conditions: [
[
{
primitive: 'custom',
type: 'Response answer',
reporting_period: 'MONTHLY',
field: 'score',
operator: 'less than',
value: '3'
}
]
]
}
}
})
};
fetch('https://app.masivo.ai/api/storefront/v1/review-forms', 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://app.masivo.ai/api/storefront/v1/review-forms",
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([
'name' => 'Post trip rating',
'description' => 'Post-trip satisfaction survey',
'type' => 'RATING',
'fields' => [
[
'name' => 'score',
'label' => 'Rating',
'type' => 'SCORE',
'required' => true,
'min' => 1,
'max' => 5
],
[
'name' => 'reason',
'label' => 'What went wrong?',
'type' => 'MULTI_SELECT',
'required' => false,
'options' => [
[
'label' => 'Wait time',
'value' => 'wait_time'
],
[
'label' => 'Service',
'value' => 'service',
'requires_comment' => true
]
]
],
[
'name' => 'comment',
'label' => 'Comment',
'type' => 'TEXT',
'required' => false
]
],
'settings' => [
'ticket_automation' => [
'enabled' => true,
'pipeline_id' => '550e8400-e29b-41d4-a716-446655440000',
'priority' => 'high',
'trigger' => 'conditions',
'conditions' => [
[
[
'primitive' => 'custom',
'type' => 'Response answer',
'reporting_period' => 'MONTHLY',
'field' => 'score',
'operator' => 'less than',
'value' => '3'
]
]
]
]
]
]),
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://app.masivo.ai/api/storefront/v1/review-forms"
payload := strings.NewReader("{\n \"name\": \"Post trip rating\",\n \"description\": \"Post-trip satisfaction survey\",\n \"type\": \"RATING\",\n \"fields\": [\n {\n \"name\": \"score\",\n \"label\": \"Rating\",\n \"type\": \"SCORE\",\n \"required\": true,\n \"min\": 1,\n \"max\": 5\n },\n {\n \"name\": \"reason\",\n \"label\": \"What went wrong?\",\n \"type\": \"MULTI_SELECT\",\n \"required\": false,\n \"options\": [\n {\n \"label\": \"Wait time\",\n \"value\": \"wait_time\"\n },\n {\n \"label\": \"Service\",\n \"value\": \"service\",\n \"requires_comment\": true\n }\n ]\n },\n {\n \"name\": \"comment\",\n \"label\": \"Comment\",\n \"type\": \"TEXT\",\n \"required\": false\n }\n ],\n \"settings\": {\n \"ticket_automation\": {\n \"enabled\": true,\n \"pipeline_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"priority\": \"high\",\n \"trigger\": \"conditions\",\n \"conditions\": [\n [\n {\n \"primitive\": \"custom\",\n \"type\": \"Response answer\",\n \"reporting_period\": \"MONTHLY\",\n \"field\": \"score\",\n \"operator\": \"less than\",\n \"value\": \"3\"\n }\n ]\n ]\n }\n }\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://app.masivo.ai/api/storefront/v1/review-forms")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Post trip rating\",\n \"description\": \"Post-trip satisfaction survey\",\n \"type\": \"RATING\",\n \"fields\": [\n {\n \"name\": \"score\",\n \"label\": \"Rating\",\n \"type\": \"SCORE\",\n \"required\": true,\n \"min\": 1,\n \"max\": 5\n },\n {\n \"name\": \"reason\",\n \"label\": \"What went wrong?\",\n \"type\": \"MULTI_SELECT\",\n \"required\": false,\n \"options\": [\n {\n \"label\": \"Wait time\",\n \"value\": \"wait_time\"\n },\n {\n \"label\": \"Service\",\n \"value\": \"service\",\n \"requires_comment\": true\n }\n ]\n },\n {\n \"name\": \"comment\",\n \"label\": \"Comment\",\n \"type\": \"TEXT\",\n \"required\": false\n }\n ],\n \"settings\": {\n \"ticket_automation\": {\n \"enabled\": true,\n \"pipeline_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"priority\": \"high\",\n \"trigger\": \"conditions\",\n \"conditions\": [\n [\n {\n \"primitive\": \"custom\",\n \"type\": \"Response answer\",\n \"reporting_period\": \"MONTHLY\",\n \"field\": \"score\",\n \"operator\": \"less than\",\n \"value\": \"3\"\n }\n ]\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.masivo.ai/api/storefront/v1/review-forms")
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 \"name\": \"Post trip rating\",\n \"description\": \"Post-trip satisfaction survey\",\n \"type\": \"RATING\",\n \"fields\": [\n {\n \"name\": \"score\",\n \"label\": \"Rating\",\n \"type\": \"SCORE\",\n \"required\": true,\n \"min\": 1,\n \"max\": 5\n },\n {\n \"name\": \"reason\",\n \"label\": \"What went wrong?\",\n \"type\": \"MULTI_SELECT\",\n \"required\": false,\n \"options\": [\n {\n \"label\": \"Wait time\",\n \"value\": \"wait_time\"\n },\n {\n \"label\": \"Service\",\n \"value\": \"service\",\n \"requires_comment\": true\n }\n ]\n },\n {\n \"name\": \"comment\",\n \"label\": \"Comment\",\n \"type\": \"TEXT\",\n \"required\": false\n }\n ],\n \"settings\": {\n \"ticket_automation\": {\n \"enabled\": true,\n \"pipeline_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"priority\": \"high\",\n \"trigger\": \"conditions\",\n \"conditions\": [\n [\n {\n \"primitive\": \"custom\",\n \"type\": \"Response answer\",\n \"reporting_period\": \"MONTHLY\",\n \"field\": \"score\",\n \"operator\": \"less than\",\n \"value\": \"3\"\n }\n ]\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "RATING",
"status": "ACTIVE",
"fields": [
{
"name": "score",
"label": "Rating",
"type": "SCORE",
"required": true,
"options": [
{
"label": "Wait time",
"value": "wait_time"
}
],
"images": [
{
"url": "<string>",
"alt": "Store front"
}
],
"min": 1,
"max": 5
}
],
"settings": {
"ticket_automation": {
"enabled": false,
"pipeline_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"priority": "medium",
"trigger": "always",
"conditions": [
[
{
"primitive": "custom",
"type": "Response answer",
"reporting_period": "MONTHLY",
"operator": "is",
"value": "<string>",
"field": "<string>"
}
]
]
}
},
"description": "<string>"
}
}{
"error": "<string>",
"details": "<string>"
}{
"error": "<string>",
"details": "<unknown>"
}Authorizations
Body
application/json