Update a Survey

/services/v2/node/{node}/survey/{survey}.json

🚧

Permissions & Notes:

There is no permission required to make this API request.

The example below depicts a request to update the survey with an ID of 321 for the question node with an ID of 123.

curl 
-u "answerhub:test123" 
-H "Accept: application/json" 
-H "Content-type: application/json" 
-X PUT 
-d '{ “title”:<string required>, “deadline”:<date ISO format>, “elements”: [ {"content”:<string required>} ]}' "https://apidocs.cloud.answerhub.com/services/v2/node/123/survey/321.json" -v

Successful Response

HTTP Status: 202

{
   “id”:<long id>,
   “creationDate”:<>,
   “modificationDate”:<>,
   “title”:"<string>",
   “deadline”:<date>,
   “surveyElement”:[
      {
         “content”:"<string>",
         “id”:<long>
      }
   ]
}

Expected Error Responses

There are 5 different error responses shown below, each in a different tab. They all have an HTTP Status 400.

400: {“error”:”Node already has a survey”}
400: {“error”:”Deadline date not set.”}
400: {“error”:”Deadline date cannot be in the past.”}
400: {“error”:”Survey title cannot be empty.”}
400: {“error”:”There should be at least 2 Survey elements and no more than 5.”}
Language
Authorization
Basic
base64
:
Click Try It! to start a request and see the response here!