Get List of Learners for an Invoice
This API can be used to find list of learners, who are linked to a single purchase. The purchase may be for just the course session, or for a program session which contains the course sessions. API can be used in case of single or bulk purchase. In case of single purchase, all returned learner records will correspond to same user, but can be for different course sessions if the purchase was for program session. In case of bulk purchase, these learner records can be for different learners.
API Details
Signature of API call
connection.invokeApi(String uri, String realUserName, Map<String, String> requestParameters);
See details about invoking API in general
Parameter 1 - URI
paymentTxnService.do
Parameter 2 - UserName
Username of any site administrator
Parameter 3 - Request Parameters
Name | Value |
dispatch | getLinkedCourseEnrollments |
No other parameters are required | |
invoiceId | invoiceId of the purchase |
csmPropertyFilter E.g. csmPropertyFilter["propname"]=propvalue |
map of name value pairs, to filter course session members (learners) using the custom property.
|
userPropertyFilter E.g. userPropertyFilter["propname"]=propvalue |
map of name value pairs, to filter users (learners) using the custom property.
|
expandCustomProp |
Comma separated entity types for which to expand the custom properties in the response. E.g. if you want the response to include custom properties of learners (course session members) then pass csm, if you want to include custom properties of users then pass user, if you want to include custom properties of coursses then pass course E.g. expandCustomProp = csm,user,course return contains the custom property names/values of all requested types |
Response
1. Response on successfully getting results
HTTP Response Code = HttpServletResponse.SC_OK
Response XML
returns invoice id (used as order id within EduBrite lms)
HTTP Response Code = HttpServletResponse.SC_OK
Response XML
<response code="0">
<msgs>
<msg>
<code>0</code>
<value><![CDATA[Success]]></value>
</msg>
</msgs>
<data>
<courseSessionMembers>
<courseSessionMember id="2fe1ddf0-8de6-11e6-a9c3-7b8f5d23978d" agreementAccepted="false" courseSessionId="d43e237e-6323-11e6-a6aa-51e7922605a9" late="false">
<userId>2fce8ff2-8de6-11e6-a9c3-7b8f5d23978d</userId>
<openId>xxxx:1234</openId>
<firstName><![CDATA[John]]></firstName>
<lastName><![CDATA[Doe]]></lastName>
<userName><![CDATA[y4il*jdoe]]></userName>
<role>STUDENT</role>
<status>ACTIVE</status>
<credits>0.0</credits>
<startDate>1475993046000</startDate>
<courseSessionName><![CDATA[Onboarding Course]]></courseSessionName>
<maxGradePoints>100.0</maxGradePoints>
<award>false</award>
<completedPreRequisites>false</completedPreRequisites>
<properties>
<!-- custom properties -->
<property>
<name><![CDATA[propname]]></name>
<value><![CDATA[propval]]></value>
</property>
</properties>
</courseSessionMember>
</courseSessionMembers>
</data>
</response>
2. Response for unauthorized access
HTTP Response Code = HttpServletResponse.SC_UNAUTHORIZED
Response XML
<response code="-1">
<msgs>
<msg>
<code>0005</code>
<value><![CDATA[You are not allowed to perform this action.]]></value>
</msg>
</msgs>
</response>
Error response when invoice not found
<response code="-1">
<msgs>
<msg>
<code>0004</code>
<value>
<![CDATA[
Unable to find Invoice with matching Id=null.
]]>
</value>
</msg>
</msgs>
</response>
Code Snippet
/* Check API Call for detail generic code */
Map<String, String> parameters = new HashMap<String, String>();
parameters.put("dispatch", "getLinkedCourseEnrollments");
parameters.put("expandCustomProp", "csm,course");
parameters.put("csmPropertyFilter["propname1"]", "propvalue1"); //propname1 must be present for the learner, value must be propvalue1 (exact)
parameters.put("csmPropertyFilter["propname2"]", "*"); //propname2 must be present for the learner, any value (not blank) will match
String retStr = connection.invokeApi("paymentTxnService.do", "chenry", parameters);
Related Pages
Group Management
Javascript
- Customization On Payment Page
- Validate IP Address while accessing the course
- UI Customization JavaScript Functions
- Verify Custom properties during Test Taking
- Verifying User Properties During Test
- JS Example
- example_custom_scripts
- Test Taking - Customization using callback mechanism
- Cms Calendar Example
Reports
Enrollment Management
- API - Update Event Subscription
- API - Create ExamTestInstance
- Update Program Member - via Program Session Id
- Update Program Member
- API - Self Enroll in Course Session
- Update Course Session Member
- API - Self Enroll in Program Session
- API - Self Enroll in Event
- API - Enroll Users in Course Session
- API - Enroll Users in Program Session
- API - Enroll Users in Event
- API - Enroll Users in Program
Other
Introduction
Report
- Get Sites Metadata
- Get Open Learning Items List
- API - Program Enrollment Summary
- API - Course Enrollment Summary
- Get Catalog Items List
- API - Course Session Members list
- API - Program Members List
- Event participants list
- Api - Test Attempts (Test Instances) List
- Test instance details list
- Api - Non Subscribed Event List
- Api - Subscribed Event List
- API - List All Report Schedules
- API - Get Latest Report Content For A Given Schedule ID
- API - Get Report Content For A Given Report ID
- API - List Reports For A Given Schedule
User Management
- API - User list
- API - Get user details
- Api - User Creation
- API - Create User (With Custom Properties)
- API - Update User
- API - Rename User
- API - Add user to group(s)
- API - Remove user from group(s)
- Merge User Accounts
- API - Activate User
- API - Deactivate User
- API - Change User's Origin Site
- Api - User Login (Creating User Session)
eCommerce
API Documentation
Examples
- User Creation
- User Update
- User List
- Get User Details
- Add User to Group(s)
- Remove User from Group(s)
- User Activate
- User Deactivate
- User Login
- Group List
- Group Membership
- Course Subscription(Coupon Code)
- Subscribed Events List
- Non Subscribed Events List
- Test Instances in Microsite
- Forum APIs
- Javascript Example
Client Example
Quick Links
- Home
- Getting Started
- Knowledgebase
- Video Tutorials
- Google Apps Integration
- Gilly (Plugin for Atlassian Confluence)
Group Management
Javascript
- Customization On Payment Page
- Validate IP Address while accessing the course
- UI Customization JavaScript Functions
- Verify Custom properties during Test Taking
- Verifying User Properties During Test
- JS Example
- example_custom_scripts
- Test Taking - Customization using callback mechanism
- Cms Calendar Example
Reports
Enrollment Management
- API - Update Event Subscription
- API - Create ExamTestInstance
- Update Program Member - via Program Session Id
- Update Program Member
- API - Self Enroll in Course Session
- Update Course Session Member
- API - Self Enroll in Program Session
- API - Self Enroll in Event
- API - Enroll Users in Course Session
- API - Enroll Users in Program Session
- API - Enroll Users in Event
- API - Enroll Users in Program
Other
Introduction
Report
- Get Sites Metadata
- Get Open Learning Items List
- API - Program Enrollment Summary
- API - Course Enrollment Summary
- Get Catalog Items List
- API - Course Session Members list
- API - Program Members List
- Event participants list
- Api - Test Attempts (Test Instances) List
- Test instance details list
- Api - Non Subscribed Event List
- Api - Subscribed Event List
- API - List All Report Schedules
- API - Get Latest Report Content For A Given Schedule ID
- API - Get Report Content For A Given Report ID
- API - List Reports For A Given Schedule
User Management
- API - User list
- API - Get user details
- Api - User Creation
- API - Create User (With Custom Properties)
- API - Update User
- API - Rename User
- API - Add user to group(s)
- API - Remove user from group(s)
- Merge User Accounts
- API - Activate User
- API - Deactivate User
- API - Change User's Origin Site
- Api - User Login (Creating User Session)
eCommerce
API Documentation
Examples
- User Creation
- User Update
- User List
- Get User Details
- Add User to Group(s)
- Remove User from Group(s)
- User Activate
- User Deactivate
- User Login
- Group List
- Group Membership
- Course Subscription(Coupon Code)
- Subscribed Events List
- Non Subscribed Events List
- Test Instances in Microsite
- Forum APIs
- Javascript Example
Client Example
Quick Links
- Home
- Getting Started
- Knowledgebase
- Video Tutorials
- Google Apps Integration
- Gilly (Plugin for Atlassian Confluence)