Definition

POST - 3/surveys/{surveyId}/respondents?includeSuccessResponses={includeSuccessResponses}

Add responses for a new respondent

Required roles: Results (write)

All actual respondents (no preview) will be charged according to your billing model.

Request information

surveyId

The id of a survey.


Type integer
Additional info
Required
includeSuccessResponses

By default, we only show the invalid survey responses in the API response. You can include the correctly processed responses on demand.


Type boolean
Additional info
Optional, Default value is False

New respondent with responses

ContactId

The id of the contact for which you are sending responses. The contact id is optional for anonymous surveys.


Type integer
LanguageCode

2-letter ISO 639-1 language code. The available language codes can be found for each survey in the Survey - Langs property.


Type string
Additional info
Required
BrowserId

The id of the browser used to complete the survey.


Type byte
Additional info
OsId

The id of the operating system used to complete the survey.


Type byte
Additional info
IpAddress

The IP address used to complete the survey.


Type string
Preview

Can be used to test your API-call, no results will be recorded but the exception handling will occur.


Type boolean
RespondentStatusId

The id shows the completion level: partial, reached end or screened out.


Type byte
Additional info
QuestionResponses

The response for this question and respondent


Type Collection of NewQuestionResponse
ElapsedTime

The elapsed time in seconds (of the page) which will be added to the current elapsed time for the entire respondent


Type integer
Sample:
{
  "LanguageCode": "en",
  "BrowserId": 64,
  "OsId": 64,
  "IpAddress": "172.16.254.1",
  "Preview": true,
  "RespondentStatusId": 64,
  "QuestionResponses": [
    {
      "QuestionId": 1,
      "Responses": [
        {
          "ResponseId": 1,
          "PointValue": 1.0,
          "Value": "sample string 2"
        },
        {
          "ResponseId": 1,
          "PointValue": 1.0,
          "Value": "sample string 2"
        }
      ]
    },
    {
      "QuestionId": 1,
      "Responses": [
        {
          "ResponseId": 1,
          "PointValue": 1.0,
          "Value": "sample string 2"
        },
        {
          "ResponseId": 1,
          "PointValue": 1.0,
          "Value": "sample string 2"
        }
      ]
    }
  ],
  "ElapsedTime": 1,
  "ContactId": 1
}
Sample:
<NewRespondent xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <ElapsedTime>1</ElapsedTime>
  <QuestionResponses>
    <NewQuestionResponse>
      <QuestionId>1</QuestionId>
      <Responses>
        <NewResponse>
          <PointValue>1</PointValue>
          <ResponseId>1</ResponseId>
          <Value>sample string 2</Value>
        </NewResponse>
        <NewResponse>
          <PointValue>1</PointValue>
          <ResponseId>1</ResponseId>
          <Value>sample string 2</Value>
        </NewResponse>
      </Responses>
    </NewQuestionResponse>
    <NewQuestionResponse>
      <QuestionId>1</QuestionId>
      <Responses>
        <NewResponse>
          <PointValue>1</PointValue>
          <ResponseId>1</ResponseId>
          <Value>sample string 2</Value>
        </NewResponse>
        <NewResponse>
          <PointValue>1</PointValue>
          <ResponseId>1</ResponseId>
          <Value>sample string 2</Value>
        </NewResponse>
      </Responses>
    </NewQuestionResponse>
  </QuestionResponses>
  <RespondentStatusId>64</RespondentStatusId>
  <BrowserId>64</BrowserId>
  <IpAddress>172.16.254.1</IpAddress>
  <LanguageCode>en</LanguageCode>
  <OsId>64</OsId>
  <Preview>true</Preview>
  <ContactId>1</ContactId>
</NewRespondent>

Response information


Meta

The metadata such as paging parameters, status code, timestamp,... which are related to this request.


Type MetaData
Data

The actual data returned by the request.


Links

HATEOAS related to this object. It wil contain relevant url's such as previous and next page for paged results, create/update/delete action. These url's can be used in your application for the next steps in your application logic.


Type Hateoas
Sample:
{
  "Meta": {
    "Status": 1,
    "TotalRowCount": 1,
    "Limit": 1,
    "Offset": 1,
    "TotalPageCount": 1,
    "StartRec": 1,
    "StopRec": 1,
    "Timestamp": "2024-10-14T08:12:09.9517837Z",
    "IsFiltered": true
  },
  "Data": {
    "RespondentId": 1,
    "Remarks": [
      "sample string 1",
      "sample string 2"
    ],
    "Results": {
      "HasErrors": true,
      "QuestionResponseResults": [
        {
          "QuestionId": 1,
          "ResponseResults": [
            {
              "ResponseId": 2,
              "PointValue": 1.0,
              "Value": "sample string 3",
              "ResultCodes": [
                "sample string 1",
                "sample string 2"
              ]
            },
            {
              "ResponseId": 2,
              "PointValue": 1.0,
              "Value": "sample string 3",
              "ResultCodes": [
                "sample string 1",
                "sample string 2"
              ]
            }
          ]
        },
        {
          "QuestionId": 1,
          "ResponseResults": [
            {
              "ResponseId": 2,
              "PointValue": 1.0,
              "Value": "sample string 3",
              "ResultCodes": [
                "sample string 1",
                "sample string 2"
              ]
            },
            {
              "ResponseId": 2,
              "PointValue": 1.0,
              "Value": "sample string 3",
              "ResultCodes": [
                "sample string 1",
                "sample string 2"
              ]
            }
          ]
        }
      ]
    },
    "Succeeded": true,
    "FailureMessage": "sample string 3"
  }
}
Sample:
<Payload xmlns:i="http://www.w3.org/2001/XMLSchema-instance" z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
  <Data>
    <FailureMessage>sample string 3</FailureMessage>
    <Succeeded>true</Succeeded>
    <Remarks xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>sample string 1</d3p1:string>
      <d3p1:string>sample string 2</d3p1:string>
    </Remarks>
    <RespondentId>1</RespondentId>
    <Results>
      <HasErrors>true</HasErrors>
      <QuestionResponseResults>
        <NewQuestionResponseResult>
          <QuestionId>1</QuestionId>
          <ResponseResults>
            <NewResponseResult>
              <PointValue>1</PointValue>
              <ResponseId>2</ResponseId>
              <ResultCodes xmlns:d8p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
                <d8p1:string>sample string 1</d8p1:string>
                <d8p1:string>sample string 2</d8p1:string>
              </ResultCodes>
              <Value>sample string 3</Value>
            </NewResponseResult>
            <NewResponseResult>
              <PointValue>1</PointValue>
              <ResponseId>2</ResponseId>
              <ResultCodes xmlns:d8p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
                <d8p1:string>sample string 1</d8p1:string>
                <d8p1:string>sample string 2</d8p1:string>
              </ResultCodes>
              <Value>sample string 3</Value>
            </NewResponseResult>
          </ResponseResults>
        </NewQuestionResponseResult>
        <NewQuestionResponseResult>
          <QuestionId>1</QuestionId>
          <ResponseResults>
            <NewResponseResult>
              <PointValue>1</PointValue>
              <ResponseId>2</ResponseId>
              <ResultCodes xmlns:d8p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
                <d8p1:string>sample string 1</d8p1:string>
                <d8p1:string>sample string 2</d8p1:string>
              </ResultCodes>
              <Value>sample string 3</Value>
            </NewResponseResult>
            <NewResponseResult>
              <PointValue>1</PointValue>
              <ResponseId>2</ResponseId>
              <ResultCodes xmlns:d8p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
                <d8p1:string>sample string 1</d8p1:string>
                <d8p1:string>sample string 2</d8p1:string>
              </ResultCodes>
              <Value>sample string 3</Value>
            </NewResponseResult>
          </ResponseResults>
        </NewQuestionResponseResult>
      </QuestionResponseResults>
    </Results>
  </Data>
  <Meta>
    <IsFiltered>true</IsFiltered>
    <Limit>1</Limit>
    <Offset>1</Offset>
    <StartRec>1</StartRec>
    <Status>1</Status>
    <StopRec>1</StopRec>
    <Timestamp>2024-10-14T08:12:09.9517837+00:00</Timestamp>
    <TotalPageCount>1</TotalPageCount>
    <TotalRowCount>1</TotalRowCount>
  </Meta>
</Payload>

Related Examples

Title
Register responses from your own code