Rest - Contacts - Participants - Sessions

From Views API Documentation
Revision as of 09:57, 20 November 2012 by Wikiadmin (talk | contribs) (→‎Usage)
Jump to navigation Jump to search

Purpose

This is a read only service. It is a search API to return sessions that a participant is associated with.

Base URL

http://app.views.coop/api/restful/contacts/participants/<id>/sessions

Usage

curl --url <Base URL>?q=<query> -u<username>:<password> -H Content-Type:text/xml 

Calling the Base URL without any parameters will return all Sessions that a participant is associated with, regardless of their attendance status.

Parameter:

  • q - string - A string to search the results for
  • SessionGroupID - int - Restrict the results to a given Session Group
  • Attended - int - 1 = Attended, 0 = Registered Only

This returns something along the lines of:

<?xml version="1.0" encoding="utf-8"?>
<participant id="104240">
    <sessions>
        <session id="164">
        <SessionID>164</SessionID>
        <SessionGroupID>38</SessionGroupID>
        <Title>Session 1</Title>
        <Type>Individual</Type>
        <StartDate>2010-10-10T12:00</StartDate>
        <Duration>01:00</Duration>
        <Status>Booked</Status>
        <Link>/restful/work/sessiongroups/sessions/164/participants</Link>
    </session>
    <session id="573">
        <SessionID>573</SessionID>
        <SessionGroupID>7</SessionGroupID>
        <Title>Session 2</Title>
        <Type>Individual</Type>
        <StartDate>2012-10-02T12:00</StartDate>
        <Duration>01:00</Duration>
        <Status>Attended</Status>
        <Link>/restful/work/sessiongroups/sessions/573/participants</Link>
        </session>
    </sessions>
</participant>