POST: https://{env}-api.xebo.ai/v3/survey-management/surveys/{survey_id}/blocks/{block_id}
The value of environment {{env}} variable depends upon your datacenter. Refer to the Environment page for more details.
Key | Type | Mandatory | Description |
---|---|---|---|
refQuesId | string | no | Question ID where you want to split the block |
Headers
"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
Payload
{
"title": "Block 1"
}
Key | Type | Mandatory | Description |
---|---|---|---|
title | string | yes | Title of the block |
cURL
curl --location 'https://az4-api.xebo.ai/v3/survey-management/surveys/951381d4-e7d1-4e5a-85f1-be379b18045a/blocks/ddba1c08-de89-4106-ac0d-90c86744708c' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
--data '{
"title": "Block 1"
} '
JavaScript
var data = JSON.stringify({
"title": "Block 1"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://az4-api.xebo.ai/v3/survey-management/surveys/951381d4-e7d1-4e5a-85f1-be379b18045a/blocks/ddba1c08-de89-4106-ac0d-90c86744708c");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90kiGTfnGBjAdbOLJc");
xhr.send(data);
Responses
{
"data": {
"pageOne": {
"_id": "642d8b06b12c23afa230028f",
"org": "74b7d757-c9e5-4c24-9505-abd3c19bf416",
"surveyId": "987efd25-7cf7-41a6-b3b4-d250a9e34f0e",
"uuid": "7fe16c2c-5299-43cd-a142-48fba787dde0",
"createdAt": "2023-04-05T14:51:50.018Z",
"updatedAt": "2023-04-05T17:20:13.746Z",
"__v": 0,
"questions": [
{
"_id": "642dab209a6d2bf462a32fca",
"org": "74b7d757-c9e5-4c24-9505-abd3c19bf416",
"surveyId": "987efd25-7cf7-41a6-b3b4-d250a9e34f0e",
"title": "Overall, how satisfied or dissatisfied are you with our company?",
"description": {
"text": ""
},
}
}
{
"success": false,
"code": 401,
"status": "Unauthorized",
"error": "AUTHENTICATION_ERROR",
"message": "The authorization token was not provided"
}
{
"success": false,
"code": 500,
"status": "Internal Server Error",
"error": "SERVER_ERROR",
"message": "Error in processing your request"
}
Note: Please do not share your tokens in publicly accessible areas or to anyone. Also, this token generated is valid for 24 hours only. After its expiry, you can regenerate the access token from the same API endpoint by passing the username and password or from the refresh token API with the help of refresh token.
Ask a human