Rest - Work - Session Groups - Session Staff: Difference between revisions

From Views API Documentation
Jump to navigation Jump to search
(Created page with "==Purpose== Used for administering participation by staff at sessions in the Views system. ===Base URL=== <nowiki>http://app.views.coop/api/restful/work/sessiongroups/sessio...")
 
No edit summary
Line 7: Line 7:
* '''sid''' - This is the id of the session group
* '''sid''' - This is the id of the session group


===Getting the list of staff===
==Getting the list of staff==
  curl --url <Base URL> -u<username>:<password> -H Content-Type:text/xml
  curl --url <Base URL> -u<username>:<password> -H Content-Type:text/xml


Line 28: Line 28:
  </sessiongroup>
  </sessiongroup>


==Adding Staff to a session==
===Adding a single staff to a session===
===Adding a single staff to a session===
You can add a single staff record via the following:
You can add a single staff record via the following:
Line 65: Line 66:
  </staff>
  </staff>


===Removing staff from a session===
==Removing staff from a session==
You can remove a single staff record from a session via the following:
You can remove a single staff record from a session via the following:
  curl --url <Base URL>/<pid> -u<username>:<password> -H Content-Type:text/xml -X DELETE
  curl --url <Base URL>/<pid> -u<username>:<password> -H Content-Type:text/xml -X DELETE

Revision as of 14:21, 19 June 2012

Purpose

Used for administering participation by staff at sessions in the Views system.

Base URL

http://app.views.coop/api/restful/work/sessiongroups/sessions/<sid>/staff

  • sid - This is the id of the session group

Getting the list of staff

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

This will return a list of staff that are associated with a session, similar to the following:

<session id="7">
    <staff>
        <staff id="123">
            <ContactID>123</ContactID>
            <Name>Jane Smith</Name>
            <Role>Lead</Role>
            <Attended>0</Attended>
        </staff>
        <staff id="102">
            <ContactID>102</ContactID>
            <Name>John Smith</Name>
            <Role>Assistant</Role>
            <Attended>1</Attended>
        </staff>
    <staff>
</sessiongroup>

Adding Staff to a session

Adding a single staff to a session

You can add a single staff record via the following:

curl --url <Base URL> -u<username>:<password> -H Content-Type:text/xml -X PUT
<staff>
    <ContactID>101457</ContactID>
    <Attended>0</Attended>
    <Role>Assistant</Role>
</staff>
  • Attended is either 1 or 0, 1 = Attended. This is optional and will default to 0, unless the session has started, in which case the default is 1.
  • Role - This is optional, but can contain a value of Lead or Assistant

Adding multiple staff to a session

You can also upload a a list of staff to add to the session register via the following URL

curl --url <Base URL> -u<username>:<password> -H Content-Type:text/xml -X PUT

This can be useful for setting a register of attending staff.

<staff>
    <staff>
        <ContactID>101457</ContactID>
        <Attended>0</Attended>
       <Role>Lead</Role>
    </staff>
    <staff>
        <ContactID>457</ContactID>
        <Attended>1</Attended>
        <Role>Assistant</Role>
    </staff>
    <staff>
        <ContactID>57</ContactID>
        <Attended>1</Attended>
        <Role></Role>
    </staff>
</staff>

Removing staff from a session

You can remove a single staff record from a session via the following:

curl --url <Base URL>/<pid> -u<username>:<password> -H Content-Type:text/xml -X DELETE
  • pid - The ID of the staff to add

You can also upload a a list of staff to remove from the session via the following URL

curl --url <Base URL> -u<username>:<password> -H Content-Type:text/xml -X DELETE
<staff>
    <staff>101162</staff>
    <staff>103124</staff>
    <staff>103413</staff>
</staff>