Rest - Work - Session Groups - Session Staff: Difference between revisions
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...") |
m (→Purpose) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
===Base URL=== | ===Base URL=== | ||
<nowiki> | <nowiki>https://app.viewsapp.net/api/restful/work/sessiongroups/sessions/<sid>/staff</nowiki> | ||
* '''sid''' - This is the id of the session group | * '''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 | curl --url <Base URL> -u<username>:<password> -H Content-Type:text/xml | ||
Line 14: | Line 14: | ||
<staff> | <staff> | ||
<staff id="123"> | <staff id="123"> | ||
<SessionID>25</SessionID> | |||
<SessionGroupID>7</SessionGroupID> | |||
<ContactType>Staff</ContactType> | |||
<ContactID>123</ContactID> | <ContactID>123</ContactID> | ||
<Name>Jane Smith</Name> | <Name>Jane Smith</Name> | ||
<Role>Lead</Role> | <Role>Lead</Role> | ||
<Attended>0</Attended> | <Attended>0</Attended> | ||
<Volunteering></Volunteering> | |||
</staff> | </staff> | ||
<staff id="102"> | <staff id="102"> | ||
<SessionID>25</SessionID> | |||
<SessionGroupID>7</SessionGroupID> | |||
<ContactType>Staff</ContactType> | |||
<ContactID>102</ContactID> | <ContactID>102</ContactID> | ||
<Name>John Smith</Name> | <Name>John Smith</Name> | ||
<Role>Assistant</Role> | <Role>Assistant</Role> | ||
<Attended>1</Attended> | <Attended>1</Attended> | ||
<Volunteering>Volunteered|Made Coffee</Volunteering> | |||
</staff> | </staff> | ||
<staff> | <staff> | ||
</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 36: | Line 45: | ||
<Attended>0</Attended> | <Attended>0</Attended> | ||
<Role>Assistant</Role> | <Role>Assistant</Role> | ||
<Volunteering>Volunteered|Made Coffee</Volunteering> | |||
</staff> | </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. | * 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 | * Role - This is optional, but can contain a value of Lead or Assistant | ||
* Volunteering - Values should be pipe(|) delimited. This is optional, but will clear volunteering for the member of staff for that session. | |||
===Adding multiple staff to a session=== | ===Adding multiple staff to a session=== | ||
Line 57: | Line 68: | ||
<Attended>1</Attended> | <Attended>1</Attended> | ||
<Role>Assistant</Role> | <Role>Assistant</Role> | ||
<Volunteering>Volunteered|Made Coffee</Volunteering> | |||
</staff> | </staff> | ||
<staff> | <staff> | ||
Line 62: | Line 74: | ||
<Attended>1</Attended> | <Attended>1</Attended> | ||
<Role></Role> | <Role></Role> | ||
<Volunteering>Cleaned up</Volunteering> | |||
</staff> | </staff> | ||
</staff> | </staff> | ||
'''''Please note:''' This will replace all existing participant data for the 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 |
Latest revision as of 13:06, 26 February 2016
Purpose
Used for administering participation by staff at sessions in the Views system.
Base URL
https://app.viewsapp.net/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"> <SessionID>25</SessionID> <SessionGroupID>7</SessionGroupID> <ContactType>Staff</ContactType> <ContactID>123</ContactID> <Name>Jane Smith</Name> <Role>Lead</Role> <Attended>0</Attended> <Volunteering></Volunteering> </staff> <staff id="102"> <SessionID>25</SessionID> <SessionGroupID>7</SessionGroupID> <ContactType>Staff</ContactType> <ContactID>102</ContactID> <Name>John Smith</Name> <Role>Assistant</Role> <Attended>1</Attended> <Volunteering>Volunteered|Made Coffee</Volunteering> </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> <Volunteering>Volunteered|Made Coffee</Volunteering> </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
- Volunteering - Values should be pipe(|) delimited. This is optional, but will clear volunteering for the member of staff for that session.
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> <Volunteering>Volunteered|Made Coffee</Volunteering> </staff> <staff> <ContactID>57</ContactID> <Attended>1</Attended> <Role></Role> <Volunteering>Cleaned up</Volunteering> </staff> </staff>
Please note: This will replace all existing participant data for the session
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>