Create a New Response

POST {{baseUrl}}/surveys/:surveyId/responses

Import Response Format

The fields in values depend on the survey definition. The easiest way to find this format is to perform a get a single response call for the survey which you are trying import values for Retrieve a Survey Response. The result of that call will demonstrate the format for the Create a New Response Call.

Uploading Files for File Upload Questions

Files can be included in your import to be associated with file upload questions in your survey. Select multipart/form-data as the request type in the documentation below to see the full request format.

multipart/form-data requests allow you to send multiple different entities as body parts in a single request. We can use this to create a request to upload a survey response with file attachments. A minimum of two body parts are required in addition to the files you wish to upload. 1. response: This body part is the JSON representation of the survey response. As with the regular application/json POST request for this endpoint, the minimum required object is {"values": {}}. Note that you do not need to include any file metadata in the survey response as the necessary metadata will automatically be added to the response from the files that you upload with it. 1. fileMapping: This body part is also a JSON object. Its purpose is to tell the importer which files go with which questions in your survey. E.g. if we wanted to import a file with the body part key of file1 and we wanted that file to be associated with the file upload question QID1, our fileMapping object would be {"file1": "QID1"}. For the remainder of your request you can attach up to five files. Each file must have a body part key of file1, file2, file3, file4, or file5.

Request Body

[{"name"=>"response", "value"=>"[object Object]", "datatype"=>"string"}, {"name"=>"fileMapping", "value"=>"[object Object]", "datatype"=>"string"}, {"name"=>"file1", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"file2", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"file3", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"file4", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"file5", "value"=>"<string>", "datatype"=>"string"}]

HEADERS

KeyDatatypeRequiredDescription
Idempotency-KeystringIn order to make a request to create a survey response idempotent, pass a UUID in this header. Repeated requests with the same Idempotency Key will not create duplicates.
Content-Typestring
Acceptstring

RESPONSES

status: OK

{&quot;result&quot;:{&quot;responseId&quot;:&quot;\u003cstring\u003e&quot;},&quot;meta&quot;:{&quot;httpStatus&quot;:&quot;\u003cstring\u003e&quot;,&quot;requestId&quot;:&quot;\u003cstring\u003e&quot;,&quot;notice&quot;:&quot;\u003cstring\u003e&quot;}}