Skip to content

SonaGetCoursesByPersonID

Description

This API retrieves a list of all courses the participant specified by person_id is in.

Input Parameters

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

Parameter Description / Possible Values
api_key Use API key generated for Sona admin user
person_id The person_id to retrieve courses of

Output Parameters

Will return APICourse classes and display data in an array.

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 User is not a participant.
Error Code -9 Invalid person ID

Sample Input

Request URL

https://myschool.sona-systems.com/services/SonaAPI.svc/SonaGetCoursesByPersonID?api_key=YOUR_API_KEY&person_id=1234

URL components

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

Query parameters

api_key = YOUR_API_KEY
person_id = 1234

Sample Output

<SonaGetCoursesByPersonIDResponse
  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">
  <SonaGetCoursesByPersonIDResult>
    <a:Errors i:nil="true" />
    <a:Result>
      <a:APICourse>
        <a:class_id>5</a:class_id>
        <a:class_name>My Class</a:class_name>
        <a:credits_required>30</a:credits_required>
        <a:instructor_id>9458</a:instructor_id>
        <a:instructor_id2>0</a:instructor_id2>
        <a:selectable>1</a:selectable>
      </a:APICourse>
    </a:Result>
  </SonaGetCoursesByPersonIDResult>
</SonaGetCoursesByPersonIDResponse>