Skip to content

SonaGetTimeslotsByExperimentIDDateRange

Description

This API retrieves the list of timeslots, for a particular study, within a given date range.

Input Parameters

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

Parameter Description / Possible Values
api_key Use API key generated for Sona admin user
experiment_id The experiment_id of the study
start_date Date to use for beginning of listing. Date must be formatted as: YYYY-MM-DD.
end_date Date to use for end of listing. Date must be formatted as: YYYY-MM-DD.
fill_status Optional. Defaults to S.
A = all timeslots, regardless of signups
F = full timeslots
E = empty timeslots
S = timeslots with at least one signup

Output Parameters

Returns an array of APIStudySchedule records. If no records match the request, Errors contains No records found. and Result is not populated.

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 Invalid experiment_id
Error Code Not supplied start_date is not a valid date or is not properly formatted (must be YYYY-MM-DD)
Error Code Not supplied end_date is not a valid date or is not properly formatted (must be YYYY-MM-DD)
Error Code Not supplied start_date must the same as or earlier than end_date
Error Code Not supplied No records match the supplied filters.

Sample Input

Request URL

https://myschool.sona-systems.com/services/SonaAPI.svc/SonaGetTimeslotsByExperimentIDDateRange?api_key=YOUR_API_KEY&experiment_id=123&start_date=2014-01-01&end_date=2014-12-31&fill_status=A

URL components

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

Query parameters

api_key = YOUR_API_KEY
experiment_id = 123
start_date = 2014-01-01
end_date = 2014-12-31
fill_status = A

Sample Output

<SonaGetTimeslotsByExperimentIDDateRangeResponse
  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">
  <SonaGetTimeslotsByExperimentIDDateRangeResult>
    <a:Errors i:nil="true" />
    <a:Result>
      <a:APIStudySchedule>
        <a:duration>30</a:duration>
        <a:experiment_id>123</a:experiment_id>
        <a:location>Wick Bldg.</a:location>
        <a:num_signed_up>3</a:num_signed_up>
        <a:num_students>10</a:num_students>
        <a:researcher_id>0</a:researcher_id>
        <a:study_name>Revenge Study</a:study_name>
        <a:survey_flag>0</a:survey_flag>
        <a:timeslot_date>2014-07-15T10:30:00</a:timeslot_date>
        <a:timeslot_id>470</a:timeslot_id>
        <a:videoconf_flag>1</a:videoconf_flag>
        <a:videoconf_url>https://www.zoom.com/123</a:videoconf_url>
        <a:web_flag>0</a:web_flag>
      </a:APIStudySchedule>
      <a:APIStudySchedule>
        <a:duration>30</a:duration>
        <a:experiment_id>123</a:experiment_id>
        <a:location>Wick Bldg.</a:location>
        <a:num_signed_up>2</a:num_signed_up>
        <a:num_students>3</a:num_students>
        <a:researcher_id>0</a:researcher_id>
        <a:study_name>Revenge Study</a:study_name>
        <a:survey_flag>0</a:survey_flag>
        <a:timeslot_date>2014-10-19T11:00:00</a:timeslot_date>
        <a:timeslot_id>477</a:timeslot_id>
        <a:videoconf_flag>1</a:videoconf_flag>
        <a:videoconf_url>https://www.zoom.com/123</a:videoconf_url>
        <a:web_flag>0</a:web_flag>
      </a:APIStudySchedule>
    </a:Result>
  </SonaGetTimeslotsByExperimentIDDateRangeResult>
</SonaGetTimeslotsByExperimentIDDateRangeResponse>