POST:
https://{{env}}-feedback-api.xebo.ai/v3/{{survey_id}}/response/create-response
The value of environment {{env}} variable depends upon your datacenter. Refer to the Environment page for more details.
"Content-Type": "application/json"
Authorization:
type: Bearer type
token: <access token> granted from login API
Or
x-api-key: <api key copied from the platform>
Content-Type: application/json
Request Parameters
Request Body
{
"collector_id": "91310b74-13bc-4e16-b0bf-808049460731",
"responses": [
{
"custom_variables": {
"email": "demo_user@example.com",
"fName": "John",
"lName": "Doe",
"mobile": "9999999999",
"gender": "male"
},
"response_status": "partial",
"questions": [
{
"uuid": "eb594a7b-418a-4c36-9b22-4dd676fe072b",
"answer": [
{
"row_id": "c6cc11b1-6655-4790-ba13-519f3fb1ff40",
“col_id”: “c6cc11b1-6655-4790-ba13-519f3fb1ff42”
}
]
}
]
}
The flow and methodologies are explained below:
Key | Type | Mandatory | Description |
collector_id | string | Yes | Collector Id of the survey in which you want to insert responses |
responses | object | Yes | Contains answers and eData objects |
custom_variables | object | No | Key value pair for custom variables |
response_status | string | Yes | Status of the response. Enum: [‘partial’, ‘disqualified’, ‘complete’] |
questions | array<object> | Yes | Array contains answer object with question IDs and Option/Answer IDs
|
questions.$._uuid | string | No | Question Id of the survey |
questions.$.answer
|
Array<object> | Yes | Array contains answered options/text/additional text
|
questions.$.answer.$.row_id | string | Yes | Row Id of the question. |
questions.$.answer.$.col_id | string | No | Column Id of the question. Valid for matrix questions |
questions.$.answer.$.item_id | string | No | Item Id of the question. Valid for matrix dropdown questions. |
questions.$.answer.$.text | string | No | Text, that user answered. Valid for open ended questions. |
Each REST API request returns an HTTP status code. For successful requests, it returns HTTP 200 status code. For failed requests, it returns HTTP 4XX or 5XX status codes. The status codes are explained below:
Request Sample
curl --location 'https://az4-feedback-api.xebo.ai/v3/9be04bc0-3e08-4f03-996e-315281bed083/response/create-response' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNz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ZTl1QmZNNHovWVgxN0NuLzhZZFNZT1I0eHFSTmZqZ3Znc3FVVGo4aEhsRnArZi93T08wYVordVE0QUFBPT0ifQ.4h7MKol3jaNyuDU_jOwrSW4FiW-kiGTfnGBjAdbOLJc' \
--data-raw '{
"collector_id": "80cdd40c-dd4f-4c01-bace-33798e7ec65f",
"responses": [
{
"custom_variables": {
"email": "demo_user@example.com",
"fName": "John",
"lName": "Doe",
"mobile": "9999999999",
"gender": "male"
},
"response_status": "partial",
"questions": [
{
"uuid": "9b9c3746-e3fa-4102-bc62-1f4566b97aa7",
"answer": [
{
"row_id": "0e7702e0-5f99-4820-8a61-312575ba520c"
}
]
}
]
}
]
}'
var data = JSON.stringify({
"collector_id": "80cdd40c-dd4f-4c01-bace-33798e7ec65f",
"responses": [
{
"custom_variables": {
"email": "demo_user@example.com",
"fName": "John",
"lName": "Doe",
"mobile": "9999999999",
"gender": "male"
},
"response_status": "partial",
"questions": [
{
"uuid": "9b9c3746-e3fa-4102-bc62-1f4566b97aa7",
"answer": [
{
"row_id": "0e7702e0-5f99-4820-8a61-312575ba520c"
}
]
}
]
}
]
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://az4-feedback-api.xebo.ai/v3/9be04bc0-3e08-4f03-996e-315281bed083/response/create-response");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzI0Mzk2ODA1LCJpYXQiOjE3MjQzMTA0MDUsImp0aSI6IjQ4ZmM1YTIxNDNmODQ5MjdhZWY5YTZmZjlmOWU5ODZjIiwidXNlcl9pZCI6IjJkNWQxMTk5LTY4ZTUtNDMyMC1hMjEyLWM2ZjQ1NWU3ZDljYyIsImN1c3RvbV9jbGFpbSI6Ikg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31T06:04:06.193Z"
}
]
"message": "Responses are created"
}
}
{
"success": false,
"code": 400,
"status": "Bad Request",
"error": "VALIDATION_ERROR",
"message": "Invalid Responses",
"data": {
"errors": {
"name": [
"Invalid Responses"
]
}
}
}
{ "error": { "name": "Internal Server Error", "message": "We were not able to process your request" } }