Recorder/Survey

Update Recorder Questions

Update a recorder questions:

questions - Speak offer different set of questions to create and ask to your clients.

Here're the few examples with value:

  1. Single Line - "single"
  2. Multi Line - "multiple"
  3. Checkbox* - "checkbox"
  4. Radio Button* - "radiobutton"
  5. Dropdown* - "dropdownlist"
  6. Date - "date"
  7. Date & Time - "datetime"

Checkbox, Radio Button, Dropdown offers "Include Others" option.

Checkbox Sample:

{
"question":"My Checkbox question",
"isRequired":true,
"answerType":"checkbox",
"options":["Option A","Option B"],
"includeOther":false
}

Dropdown Sample with Include Other:

{
 "question": "My Dropdown Question with Include Others",
 "isRequired": true,
 "answerType": "dropdownlist",
 "options": [
 "Value 1",
 "Value 2"
 ],
 "includeOther": true
}

post/recorder/questions/{recorderId}

Request

  • Base URL: https://api.speakai.co/v1
  • URL: https://api.speakai.co/v1/recorder/questions/{recorderId}
  • Auth: API key in header x-speakai-key and API key in header x-access-token

Path parameters

recorderIdstring required

Request body

idstring

Send the id of an existing question to edit it. Leave it out to add a new question. Optional. Accepts an empty string and null, both of which are treated as 'add a new question'. If you send an id that no question on the recorder matches, the request still returns 200 but nothing changes and questionData comes back empty.

questionstring required

Write the question text a respondent sees. Required. An empty or whitespace-only value is rejected.

isRequiredboolean required

Make the respondent answer this question before they can submit. Required. There is no fallback, so you have to send it on every call, including edits.

answerTypestring required

Set the kind of answer control the question uses. Required. An empty or whitespace-only value is rejected. This route puts no.valid constraint on the value, so the server stores whatever string you send. The recorder reads these values from the RecorderAnswerType enum in @speakai/shared: single, multiple, checkbox, radiobutton, dropdownlist, date, time, datetime. The public submission route does enforce that enum with.valid, so a value outside the set is stored here and then rejected when a respondent submits an answer.

optionsstring[]

List the choices for a question that offers a fixed set of answers. Optional. Each item is a non-empty string. There is no cap on the number of items.

includeOtherboolean

Add an 'Other' choice alongside the options you listed. Optional. No fallback, so it is stored as undefined when you leave it out.

fieldIdstring

Map the answers to one of your custom fields. Optional. Accepts an empty string and null.

Response

OK

statusstring

Changes

No recorded changes to this operation across all 2 revisions of this API.