PUT: https://{env}-api.xebo.ai/v3/survey-management/surveys/global
Key | Type | Mandatory | Description |
skip | string | no | Gives the skip value, by default it is 0 |
limit | string | no | Determines the number of surveys in one page, by default it is 100. |
sort | string | no | Determines the sort order of surveys, it can be modified or created. Enum: [‘createdAt’, modifiedAt‘] |
sortOrder | string | no | Determines the sort order or surveys, it can be asc or desc. Enum: [1, -1] |
search | string | no | Search survey by title |
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 Body
{
"folderId": "3de43022-e62f-4979-aac4-b2bad11d3eb9",
}
Key | Type | Mandatory | Description |
folderId | string | no | Folder Id for the folder for which you want to fetch all surveys. |
Request Sample
curl --location --request PUT 'https://az4-api.xebo.ai/v3/survey-management/surveys' \ --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.-kiGTfnGBjAdbOLJc'
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://az4-api.xebo.ai/v3/survey-management/surveys");
xhr.setRequestHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e-kiGTfnGBjAdbOLJc");
xhr.send();
Responses
{
"data": [
{
"title": "Survey 1",
"displayTitle": "Survey 1",
"numOfResp": 0,
"numOfQues": 2,
"uuid": "6abe1ed9-d7ea-4c10-8b8f-752ca1f060b8",
"createdAt": "2023-03-16T08:36:37.842Z",
"updatedAt": "2023-03-16T08:38:20.701Z"
}
],
"count": 1
}
{
"success":false,
"code":401,
"status":"Bad Request",
"error":"AUTHENTICATION_ERROR",
"message":"Invalid parameters",
}
{
"success": false,
"code": 403,
"status": "Forbidden",
"error": "FORBIDDEN",
"message": "You are not allowed to access this resource"
}
{
"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.