Delete a survey

Prev Next
DELETE : https://{env}-api.xebo.ai/v3/survey-management/surveys

Query Params:

Key

Type

Mandatory

Description

folderId

string

no

Folder id in which survey exists

Headers

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

Payload

 {   
  "surveyIdsArr": 
  [     "0f755853-9120-41e2-be81-7b2422dec4bb"   ] 
 } 

Key

Type

Mandatory

Description

surveyIdsArr

array

yes

Survey ids of the surveys to be deleted

Request Sample

cURL

curl --location --request DELETE 'https://az4-api.xebo.ai/v3/survey-management/surveys?folderId=a4bbed99-516a-4cc2-8fbd-841405fb8d1a' \ 

--header 'Content-Type: application/json' \ 
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
--data '{ 

  "surveyIdsArr": [ 
    "7bef347f-050e-42bd-a092-be7d07439fdc" 
  ] 
}' 

JavaScript

 var data = JSON.stringify({ 
   "surveyIdsArr": [ 
     "7bef347f-050e-42bd-a092-be7d07439fdc" 
   ] 
 }); 

 var xhr = new XMLHttpRequest(); 
 xhr.withCredentials = true; 
 xhr.addEventListener("readystatechange", function() { 
   if(this.readyState === 4) { 
     console.log(this.responseText); 
   } 
 }); 

 xhr.open("DELETE", "https://az4-api.xebo.ai/v3/survey-management/surveys?folderId=a4bbed99-516a-4cc2-8fbd-841405fb8d1a"); 
 xhr.setRequestHeader("Content-Type", "application/json"); 
 xhr.setRequestHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e-kiGTfnGBjAdbOLJc"); 

 xhr.send(data); 

Responses

 { 
   "message": "Survey(s) deleted successfully." 
 } 
 { 
   "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.

Ask a human

Can't Find What You're Looking For?

Email Support       Chat With Us      Ticket Generate