put https://apidocs.cloud.answerhub.com/services/v2/node//survey/.json
/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.ā}