Submit Questionnaire
curl --request POST \
--url https://api.{tenant}.getomneo.com/api/v3/questionnaires/{questionnaire}/submissions \
--header 'Content-Type: application/json' \
--data '
{
"profile_id": "<string>",
"answerable": {
"id": "<string>"
},
"answers": [
{
"value": "<string>",
"questionnaire_question_id": 123,
"question_id": 123,
"question_handle": "<string>"
}
],
"context": [
"<string>"
]
}
'import requests
url = "https://api.{tenant}.getomneo.com/api/v3/questionnaires/{questionnaire}/submissions"
payload = {
"profile_id": "<string>",
"answerable": { "id": "<string>" },
"answers": [
{
"value": "<string>",
"questionnaire_question_id": 123,
"question_id": 123,
"question_handle": "<string>"
}
],
"context": ["<string>"]
}
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({
profile_id: '<string>',
answerable: {id: '<string>'},
answers: [
{
value: '<string>',
questionnaire_question_id: 123,
question_id: 123,
question_handle: '<string>'
}
],
context: ['<string>']
})
};
fetch('https://api.{tenant}.getomneo.com/api/v3/questionnaires/{questionnaire}/submissions', 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.{tenant}.getomneo.com/api/v3/questionnaires/{questionnaire}/submissions",
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([
'profile_id' => '<string>',
'answerable' => [
'id' => '<string>'
],
'answers' => [
[
'value' => '<string>',
'questionnaire_question_id' => 123,
'question_id' => 123,
'question_handle' => '<string>'
]
],
'context' => [
'<string>'
]
]),
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.{tenant}.getomneo.com/api/v3/questionnaires/{questionnaire}/submissions"
payload := strings.NewReader("{\n \"profile_id\": \"<string>\",\n \"answerable\": {\n \"id\": \"<string>\"\n },\n \"answers\": [\n {\n \"value\": \"<string>\",\n \"questionnaire_question_id\": 123,\n \"question_id\": 123,\n \"question_handle\": \"<string>\"\n }\n ],\n \"context\": [\n \"<string>\"\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.{tenant}.getomneo.com/api/v3/questionnaires/{questionnaire}/submissions")
.header("Content-Type", "application/json")
.body("{\n \"profile_id\": \"<string>\",\n \"answerable\": {\n \"id\": \"<string>\"\n },\n \"answers\": [\n {\n \"value\": \"<string>\",\n \"questionnaire_question_id\": 123,\n \"question_id\": 123,\n \"question_handle\": \"<string>\"\n }\n ],\n \"context\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{tenant}.getomneo.com/api/v3/questionnaires/{questionnaire}/submissions")
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 \"profile_id\": \"<string>\",\n \"answerable\": {\n \"id\": \"<string>\"\n },\n \"answers\": [\n {\n \"value\": \"<string>\",\n \"questionnaire_question_id\": 123,\n \"question_id\": 123,\n \"question_handle\": \"<string>\"\n }\n ],\n \"context\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"submission_id": 123,
"questionnaire_id": 123,
"submitted_count": 123,
"answerable": {
"type": "<string>",
"id": "<string>"
},
"context": [
"<unknown>"
],
"submitted_at": "<string>",
"answers": [
{
"id": 123,
"questionnaire_id": 123,
"questionnaire_question_id": 123,
"question_id": 123,
"question_version_id": 123,
"profile_id": "<string>",
"answerable_type": "<string>",
"answerable_id": "<string>",
"mapping_key": "<string>",
"link_type": "<string>",
"link_target": "<string>",
"link_write_policy": "<string>",
"question_label": "<string>",
"question_type": "<string>",
"question_required": true,
"answer_type": "<string>",
"value": true,
"mappable_type": "<string>",
"mappable_id": "<string>",
"mapped_field": "<string>",
"mapping_status": "<string>",
"mapping_error": "<string>",
"mapped_at": "<string>",
"meta": [
"<unknown>"
],
"created_at": "<string>",
"updated_at": "<string>",
"question_handle": "<string>"
}
]
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Questionnaire Submission
Submit Questionnaire
A POST to the /questionnaires/{questionnaireId}/submissions endpoint allows your application to submit answers for a questionnaire.
POST
/
v3
/
questionnaires
/
{questionnaire}
/
submissions
Submit Questionnaire
curl --request POST \
--url https://api.{tenant}.getomneo.com/api/v3/questionnaires/{questionnaire}/submissions \
--header 'Content-Type: application/json' \
--data '
{
"profile_id": "<string>",
"answerable": {
"id": "<string>"
},
"answers": [
{
"value": "<string>",
"questionnaire_question_id": 123,
"question_id": 123,
"question_handle": "<string>"
}
],
"context": [
"<string>"
]
}
'import requests
url = "https://api.{tenant}.getomneo.com/api/v3/questionnaires/{questionnaire}/submissions"
payload = {
"profile_id": "<string>",
"answerable": { "id": "<string>" },
"answers": [
{
"value": "<string>",
"questionnaire_question_id": 123,
"question_id": 123,
"question_handle": "<string>"
}
],
"context": ["<string>"]
}
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({
profile_id: '<string>',
answerable: {id: '<string>'},
answers: [
{
value: '<string>',
questionnaire_question_id: 123,
question_id: 123,
question_handle: '<string>'
}
],
context: ['<string>']
})
};
fetch('https://api.{tenant}.getomneo.com/api/v3/questionnaires/{questionnaire}/submissions', 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.{tenant}.getomneo.com/api/v3/questionnaires/{questionnaire}/submissions",
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([
'profile_id' => '<string>',
'answerable' => [
'id' => '<string>'
],
'answers' => [
[
'value' => '<string>',
'questionnaire_question_id' => 123,
'question_id' => 123,
'question_handle' => '<string>'
]
],
'context' => [
'<string>'
]
]),
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.{tenant}.getomneo.com/api/v3/questionnaires/{questionnaire}/submissions"
payload := strings.NewReader("{\n \"profile_id\": \"<string>\",\n \"answerable\": {\n \"id\": \"<string>\"\n },\n \"answers\": [\n {\n \"value\": \"<string>\",\n \"questionnaire_question_id\": 123,\n \"question_id\": 123,\n \"question_handle\": \"<string>\"\n }\n ],\n \"context\": [\n \"<string>\"\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.{tenant}.getomneo.com/api/v3/questionnaires/{questionnaire}/submissions")
.header("Content-Type", "application/json")
.body("{\n \"profile_id\": \"<string>\",\n \"answerable\": {\n \"id\": \"<string>\"\n },\n \"answers\": [\n {\n \"value\": \"<string>\",\n \"questionnaire_question_id\": 123,\n \"question_id\": 123,\n \"question_handle\": \"<string>\"\n }\n ],\n \"context\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{tenant}.getomneo.com/api/v3/questionnaires/{questionnaire}/submissions")
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 \"profile_id\": \"<string>\",\n \"answerable\": {\n \"id\": \"<string>\"\n },\n \"answers\": [\n {\n \"value\": \"<string>\",\n \"questionnaire_question_id\": 123,\n \"question_id\": 123,\n \"question_handle\": \"<string>\"\n }\n ],\n \"context\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"submission_id": 123,
"questionnaire_id": 123,
"submitted_count": 123,
"answerable": {
"type": "<string>",
"id": "<string>"
},
"context": [
"<unknown>"
],
"submitted_at": "<string>",
"answers": [
{
"id": 123,
"questionnaire_id": 123,
"questionnaire_question_id": 123,
"question_id": 123,
"question_version_id": 123,
"profile_id": "<string>",
"answerable_type": "<string>",
"answerable_id": "<string>",
"mapping_key": "<string>",
"link_type": "<string>",
"link_target": "<string>",
"link_write_policy": "<string>",
"question_label": "<string>",
"question_type": "<string>",
"question_required": true,
"answer_type": "<string>",
"value": true,
"mappable_type": "<string>",
"mappable_id": "<string>",
"mapped_field": "<string>",
"mapping_status": "<string>",
"mapping_error": "<string>",
"mapped_at": "<string>",
"meta": [
"<unknown>"
],
"created_at": "<string>",
"updated_at": "<string>",
"question_handle": "<string>"
}
]
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}⌘I