Api - Non Subscribed Event List

Non Subscribed Event List

This API is used to obtain the list of events to which a user is not yet subscribed. This list can be used by a user to choose an event to subscribe to.

 

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

eventService.do

 

Parameter 2 - UserName

Username of any site administrator or group administrator

 

Parameter 3 - Request Parameters

Name Value
dispatch eventCalendar
xml true
viewType PRESENT_FUTURE
subscriptionType NOT_SUBSCRIBED
listStyle CATALOG_LIST
showCal false
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
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.
pageSize Number of items in a page, default value is 10.

 

Response

Response on successfully getting the event list

HTTP Response Code = HttpServletResponse.SC_OK

Response XML

<response code="0">
    <msgs>
        <msg>
            <code>0</code>
            <value>
            <![CDATA[Success]]>
            </value>
        </msg>
    </msgs>


    <data>
        <events numItems="2" currPage="0" pageSize="10">
            <event id="3df4617a-5b72-11e1-8a65-0030489d05ee" type="CBT" status="IN_PROGRESS">
                <name><![CDATA[American History Exam 1]]></name>
                <startDate>1329706769000</startDate>
                <endDate>1330140589000</endDate>
                <resultDate>1330139989000</resultDate>
                <subscribed>false</subscribed>
                <partiallySubscribed>false</partiallySubscribed>
                <canSubscribe>false</canSubscribe>
                <eventItems>
                </eventItems>
            </event>
           
            <event id="f26b5044-5359-11e1-8a65-0030489d05ee" type="SUBSCRIPTION" status="IN_PROGRESS">
                <name><![CDATA[Subscription]]></name>
                <startDate>1328816026000</startDate>
                <endDate>1355081626000</endDate>
                <subscribed>false</subscribed>
                <partiallySubscribed>false</partiallySubscribed>
                <logo><![CDATA[../att/9942c9b6-535e-11e1-8a65-0030489d05ee]]></logo>
                <canSubscribe>true</canSubscribe>
                <canBuy>true</canBuy>
                <price>10.0</price>
                <currency>USD</currency>
                <paymentProviders><![CDATA[Offline]]></paymentProviders>
                <courseSessionId>e62e8ef8-5355-11e1-8a65-0030489d05ee</courseSessionId>
                <eventItems>
                </eventItems>
            </event>
        </events>
    </data>
</response>

 

Code Snippet

 

    /* Check API Call for detail generic code */
    Map<String, String> parameters = new HashMap<String, String>();
    parameters.put("dispatch", "eventCalendar");
    parameters.put("xml", String.valueOf(true));
    parameters.put("viewType", "PRESENT_FUTURE");
    parameters.put("subscriptionType", "NOT_SUBSCRIBED");
    parameters.put("listStyle", "CATALOG_LIST");
    parameters.put("showCal", String.valueOf(false));
    String retStr = connection.invokeApi("eventService.do", "charles", parameters);
    System.out.println(retStr);

 

 


Rating: