Get Open Learning Items List

Fetches Openlearning Lessons

This API return openlearning lessons

 

API Details

Signature of the API

connection.invokeApi(String uri, String realUserName, Map<String, String> requestParameters);

See details about invoking API in general

Parameter 1: uri

openlearnService.do

Parameter 2: realUserName

Username of the site admin

Parameter 3: requestParameters

Name Value Default
dispatch getLessonsSummary  
searchName To filter results for the given searchName.
Supported prefix:
  • No prefix (for searching by name of lesson)
  • "cat:" (for searching by category tagged on lesson)
  • "author:" (for searching by author name of the lesson)
 
video boolean. to filter results to show only video type lessons false
file boolean. to filter results to show only file type lessons false
utube boolean. to filter results to show only YouTube type lessons false
vimeo boolean. to filter results to show only Vimeo type lessons false
subject1, subject2, subject3 To filter results for the given subject metadata  
region1, region2, region3 To filter results for the given region metadata  
complexity To filter results for the given complexity metadata  
skillLevel To filter results for the given skillLevel metadata  
exam To filter results for the given exam metadata  
Paging related parameters
pageSize Number of items in a page 10
currPage page number to fetch, must be specified for 2nd page onwards. Value of currPage starts with 0. So for page 2 specify currPage = 1 -1
numItems total records in the list, must be specified for 2nd page onwards. You can get the count of records from response of first page. then pass it as-is in subsequent pages. 0
sortColumn
  • "doc.document.name": sort by name
  • "doc.traceData.createdDt": sort by created date
  • "item.sequence,doc.sequence": sort by created date
  • "random": sort randomly
doc.document.name
sortAsc boolean. true to fetch records in ascending order, false for descending. false

 

Response

On Success:

HTTP Response Code = HttpServletResponse.SC_OK

Sample response

<response code="0">
    <msgs>
        <msg>
            <code>0</code>
            <value>
                <![CDATA[Success]]>
            </value>
        </msg>
    </msgs>
    <data>
        <lessons>
            <lesson gradable="true" id="16384e64-7544-11e9-9035-8d335820968f" itemId="f959ec3a-7543-11e9-9035-8d335820968f" linkedDocument="false" linkedLesson="false" mandatory="false" nature="NATURE_VIMEO_VIDEO" noLockOnMandatory="false" sequence="" showToc="true" status="ACTIVE" uiFitSize="true" viewNoSession="true" viewOnDemand="true" viewable="false">
                <description/>
                <chaptersInfo/>
                <extVideoId>
                    <![CDATA[vimeo://334229704]]>
                </extVideoId>
                <numPages>
                    <![CDATA[1]]>
                </numPages>
                <duration/>
                <doc id="1637b936-7544-11e9-9035-8d335820968f" version="1">
                    <name>
                        <![CDATA[New Vimeo Video]]>
                    </name>
                    <properties>
                        <property name="DOC_PROCESSED_VER">
                            <value>
                                <![CDATA[1]]>
                            </value>
                        </property>
                        <property name="DURATION_SEC">
                            <value>
                                <![CDATA[581]]>
                            </value>
                        </property>
                        <property name="EXT_VIDEO">
                            <value>
                                <![CDATA[vimeo://334229704]]>
                            </value>
                        </property>
                        <property name="POINTS">
                            <value>
                                <![CDATA[-99999]]>
                            </value>
                        </property>
                        <property name="PREVIEW_LIMIT">
                            <value>
                                <![CDATA[-99999]]>
                            </value>
                        </property>
                    </properties>
                </doc>
            </lesson>
        </lessons>
    </data>
</response>

 

Code Snippet

 

/* Check API Call for detail */

Map<String, String> parameters = new HashMap<String, String>();
populateMap(parameters);
String result = connection.invokeApi("openlearnService.do", "adminusername", parameters);
System.out.println(result);
 
private void populateMap(Map<String, String> parameters) {
    parameters.put("dispatch", "getLessonsSummary");
    parameters.put("searchName", "cat:category1");
}

Rating: