Skip to content

SonaGetPrescreenSurveyDataByPersonID

Description

This API call retrieves the list of prescreen or survey responses of a particular participant.

Input Parameters

Below are the following input parameters for use with the SonaGetPrescreenSurveyDataByPersonID API function.

Parameter Description / Possible Values
api_key Use API key generated for Sona admin user
experiment_id The experiment_id of the study. Pass in 0 for the prescreen.
person_id The person_id of the participant.

Output Parameters

Returns a single APIPrescreenSurveyData result for the participant.

Error Codes

Below are the possible error messages encountered and their respective descriptions.

Error Type Error Code Description
Authentication Failed -1 through -7 Standard authentication errors
Error Code -8 no prescreen nor survey found for the specified experiment_id
Error Code -9 No prescreen response record or user record was found.
Error Code -10 Invalid experiment_id
Error Code -11 Invalid person_id

Sample Input

Request URL

https://myschool.sona-systems.com/services/SonaAPI.svc/SonaGetPrescreenSurveyDataByPersonID?api_key=YOUR_API_KEY&experiment_id=0&person_id=9444

URL components

Component Value
Scheme https
Host myschool.sona-systems.com
Service path /services/SonaAPI.svc
Function SonaGetPrescreenSurveyDataByPersonID

Query parameters

api_key = YOUR_API_KEY
experiment_id = 0
person_id = 9444

Sample Output

<SonaGetPrescreenSurveyDataByPersonIDResponse
  xmlns="https://www.sona-systems.com/"
  xmlns:a="http://schemas.datacontract.org/2004/07/emsdotnet.sonasystems"
  xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <SonaGetPrescreenSurveyDataByPersonIDResult>
    <a:Errors i:nil="true" />
    <a:Result>
      <a:anon_id_code />
      <a:data_status>S</a:data_status>
      <a:end_time>2013-05-07T00:26:02</a:end_time>
      <a:first_name>Jim</a:first_name>
      <a:last_name>Smith</a:last_name>
      <a:person_id>9444</a:person_id>
      <a:pretest_id>10</a:pretest_id>
      <a:responses>
        <a:APIPrescreenSurveyResponseItem>
          <a:choice_id>462</a:choice_id>
          <a:opt_out_choice>0</a:opt_out_choice>
          <a:question_id>17</a:question_id>
          <a:response_id>1020</a:response_id>
          <a:response_numeric>0</a:response_numeric>
          <a:response_text>4 sup</a:response_text>
        </a:APIPrescreenSurveyResponseItem>
        <a:APIPrescreenSurveyResponseItem>
          <a:choice_id>132</a:choice_id>
          <a:opt_out_choice>0</a:opt_out_choice>
          <a:question_id>27</a:question_id>
          <a:response_id>1021</a:response_id>
          <a:response_numeric>0</a:response_numeric>
          <a:response_text>kinda</a:response_text>
        </a:APIPrescreenSurveyResponseItem>
        <a:APIPrescreenSurveyResponseItem>
          <a:choice_id>147</a:choice_id>
          <a:opt_out_choice>0</a:opt_out_choice>
          <a:question_id>32</a:question_id>
          <a:response_id>1022</a:response_id>
          <a:response_numeric>0</a:response_numeric>
          <a:response_text>erg</a:response_text>
        </a:APIPrescreenSurveyResponseItem>
        <a:APIPrescreenSurveyResponseItem>
          <a:choice_id>293</a:choice_id>
          <a:opt_out_choice>0</a:opt_out_choice>
          <a:question_id>75</a:question_id>
          <a:response_id>1023</a:response_id>
          <a:response_numeric>0</a:response_numeric>
          <a:response_text>yeah!</a:response_text>
        </a:APIPrescreenSurveyResponseItem>
      </a:responses>
      <a:start_time>2013-05-07T00:25:36</a:start_time>
      <a:status>C</a:status>
      <a:user_id>jsmith</a:user_id>
    </a:Result>
  </SonaGetPrescreenSurveyDataByPersonIDResult>
</SonaGetPrescreenSurveyDataByPersonIDResponse>