Rest - Work - Session Groups - Participants: Difference between revisions
(Keeping docs up to date with API changes in 5052) |
|||
(7 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/<sid>/participants</nowiki> | ||
* '''sid''' - This is the id of the session group | * '''sid''' - This is the id of the session group | ||
Line 48: | Line 48: | ||
===Adding participants to a non-bookable session group=== | ===Adding participants to a non-bookable session group=== | ||
You can add a single participant via the following: | You can add a single participant via the following: | ||
curl --url <Base URL>/<pid> -u<username>:<password> -H Content-Type:text/xml -X | curl --url <Base URL>/<pid> -u<username>:<password> -H Content-Type:text/xml -X POST | ||
*'''pid''' - The ID of the participant to add | *'''pid''' - The ID of the participant to add | ||
Line 63: | Line 63: | ||
Due to financial information being required for bookable session groups the method of adding participants in slightly different. | Due to financial information being required for bookable session groups the method of adding participants in slightly different. | ||
curl --url <Base URL> -u<username>:<password> -H Content-Type:text/xml -X POST | |||
<participant> | <participant> | ||
<PersonID>100748</PersonID> | <PersonID>100748</PersonID> | ||
Line 70: | Line 71: | ||
<PaymentFee>2.50</PaymentFee> | <PaymentFee>2.50</PaymentFee> | ||
<PaymentReference>7002</PaymentReference> | <PaymentReference>7002</PaymentReference> | ||
<Confirmed>1</Confirmed> | |||
<Forename>Father</Forename> | <Forename>Father</Forename> | ||
<Surname>Test</Surname> | <Surname>Test</Surname> | ||
Line 79: | Line 81: | ||
<Telephone/> | <Telephone/> | ||
<Email>test@test.com</Email> | <Email>test@test.com</Email> | ||
</participant> | </participant> | ||
This will return errors on a fail or the full booking record on a successful submit. | This will return errors on a fail or the full booking record on a successful submit. | ||
Line 87: | Line 89: | ||
* PaymentType - One of the following value 'Cash', 'Cheque', 'Debit Card', 'Credit Card', 'Other' | * PaymentType - One of the following value 'Cash', 'Cheque', 'Debit Card', 'Credit Card', 'Other' | ||
* PaymentAmount - This is the amount paid | * PaymentAmount - This is the amount paid | ||
'''''Note:''''' If the Booking Mode is Session, then you will be required to pass an extra <code>SessionID</code> element. For example: | |||
<participant> | |||
<SessionID>776</SessionID> | |||
<PersonID>100748</PersonID> | |||
<PaymentType>Debit Card</PaymentType> | |||
<PaymentAmount>20</PaymentAmount> | |||
<PaymentFee>2.50</PaymentFee> | |||
<PaymentReference>7002</PaymentReference> | |||
<Confirmed>1</Confirmed> | |||
<Forename>Father</Forename> | |||
<Surname>Test</Surname> | |||
<Address1/> | |||
<Address2/> | |||
<Town/> | |||
<County/> | |||
<Postcode/> | |||
<Telephone/> | |||
<Email>test@test.com</Email> | |||
</participant> | |||
'' It is prefered that you use the [[Rest - Work - Session Groups - Session Participants|Session Participants]] API '' | |||
==Removing participants from a session group== | ==Removing participants from a session group== | ||
===Removing participants from a non bookable session group=== | |||
You can remove a single participant from a session group via the following: | You can remove a single participant from a session group 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 | ||
Line 101: | Line 125: | ||
<participant>103413</participant> | <participant>103413</participant> | ||
</participants> | </participants> | ||
In either case server will respond in such format with status for each individual participant: | |||
<work> | |||
<participant id="1">Does not exist</participant> | |||
<participant id="2">Deleted</participant> | |||
<participant id="3">Archived</participant> | |||
</work> | |||
'''''Note:''''' If participant has attended a Session within target Session Group and therefore can't be removed from Session Group register - his record will be archived. | |||
===Removing participants from a bookable session group=== | |||
You can only remove a single participant's booking from a session group via the following: | |||
curl --url <Base URL>/<pid> -u<username>:<password> -H Content-Type:text/xml -X DELETE | |||
*'''pid''' - The ID of the participant to remove | |||
By default this will flag the participant as cancelled, but will not do anything with the financial side of the booking. To flag a refund was give or a credit note, you should pass the following: | |||
<refundtype>Refund</refundtype> | |||
or | |||
<refundtype>Credit</refundtype> | |||
This will result in the participants booking being completely being removed from the session group | |||
==Making payments to a booking== | |||
curl --url <Base URL>/<id> -u<username>:<password> -H Content-Type:text/xml -X PUT -d '<xml>' | |||
* *id* - This is the participant id | |||
The data for submitting a payment record is currently quite basic. It is our intention to expand on this: | |||
<payment> | |||
<PaymentType>Debit Card</PaymentType> | |||
<PaymentAmount>20</PaymentAmount> | |||
</payment> | |||
* PaymentType - This must be one of the following values 'Cash', 'Cheque', 'Debit Card', 'Credit Card', 'Other' | |||
* PaymentAmount - This is an amount in pounds.pence | |||
==Confirming/Unconfirming a booking== | |||
curl --url <Base URL>/<id> -u<username>:<password> -H Content-Type:text/xml -X PUT -d '<xml>' | |||
* *id* - This is the participant id | |||
The data for submitting a payment record is currently quite basic. It is our intention to expand on this: | |||
<booking> | |||
<Confirmed>1</Confirmed> | |||
</booking>' | |||
This can also be combined with a payment as such: | |||
<payment> | |||
<PaymentType>Debit Card</PaymentType> | |||
<PaymentAmount>20</PaymentAmount> | |||
<Confirmed>1</Confirmed> | |||
</payment> |
Latest revision as of 12:24, 18 March 2019
Purpose
Used for administering participant registrations on session groups in the Views system.
Base URL
https://app.viewsapp.net/api/restful/work/sessiongroups/<sid>/participants
- sid - This is the id of the session group
Note: If the Session Group has been archived, this API becomes read only.
Getting the list of participants
curl --url <Base URL> -u<username>:<password> -H Content-Type:text/xml
This will return a list of participants that are associated wit the session group, similar to the following:
<sessiongroup id="7"> <participants> <participant id="123"> <Name>Jane Smith</Name> <Type>1</Type> <Attended/> <FirstAttended/> <Nickname/> <Forename>Jane</Forename> <Surname>Smith</Surname> ... <EngagmentLevel>0</EngagmentLevel> <EngagmentLevelName>Not Set</EngagmentLevelName> </participant> <participant id="102"> <Name>John Smith</Name> <Type>1</Type> <Attended/> <FirstAttended/> <Nickname/> <Forename>john</Forename> <Surname>Smith</Surname> ... <EngagmentLevel>0</EngagmentLevel> <EngagmentLevelName>Not Set </EngagmentLevelName> </participant> <participants> </sessiongroup>
Note: If the Session Group is bookable, each participant record will also contain a booking object as well.
Adding participants to a session group
Adding participants to a non-bookable session group
You can add a single participant via the following:
curl --url <Base URL>/<pid> -u<username>:<password> -H Content-Type:text/xml -X POST
- pid - The ID of the participant to add
You can also upload a a list of participants to add to the session register via the following URL
curl --url <Base URL> -u<username>:<password> -H Content-Type:text/xml -X PUT
<participants> <participant>101162</participant> <participant>103124</participant> <participant>103413</participant> </participants>
Adding participants to a bookable session groups
Due to financial information being required for bookable session groups the method of adding participants in slightly different.
curl --url <Base URL> -u<username>:<password> -H Content-Type:text/xml -X POST
<participant> <PersonID>100748</PersonID> <PaymentType>Debit Card</PaymentType> <PaymentAmount>20</PaymentAmount> <PaymentFee>2.50</PaymentFee> <PaymentReference>7002</PaymentReference> <Confirmed>1</Confirmed> <Forename>Father</Forename> <Surname>Test</Surname> <Address1/> <Address2/> <Town/> <County/> <Postcode/> <Telephone/> <Email>test@test.com</Email> </participant>
This will return errors on a fail or the full booking record on a successful submit.
The required fields are all required:
- PersonID - This is the ID of the participant
- PaymentType - One of the following value 'Cash', 'Cheque', 'Debit Card', 'Credit Card', 'Other'
- PaymentAmount - This is the amount paid
Note: If the Booking Mode is Session, then you will be required to pass an extra SessionID
element. For example:
<participant> <SessionID>776</SessionID> <PersonID>100748</PersonID> <PaymentType>Debit Card</PaymentType> <PaymentAmount>20</PaymentAmount> <PaymentFee>2.50</PaymentFee> <PaymentReference>7002</PaymentReference> <Confirmed>1</Confirmed> <Forename>Father</Forename> <Surname>Test</Surname> <Address1/> <Address2/> <Town/> <County/> <Postcode/> <Telephone/> <Email>test@test.com</Email> </participant>
It is prefered that you use the Session Participants API
Removing participants from a session group
Removing participants from a non bookable session group
You can remove a single participant from a session group via the following:
curl --url <Base URL>/<pid> -u<username>:<password> -H Content-Type:text/xml -X DELETE
- pid - The ID of the participant to add
You can also upload a a list of participants to remove from the session group via the following URL
curl --url <Base URL> -u<username>:<password> -H Content-Type:text/xml -X DELETE
<participants> <participant>101162</participant> <participant>103124</participant> <participant>103413</participant> </participants>
In either case server will respond in such format with status for each individual participant:
<work> <participant id="1">Does not exist</participant> <participant id="2">Deleted</participant> <participant id="3">Archived</participant> </work>
Note: If participant has attended a Session within target Session Group and therefore can't be removed from Session Group register - his record will be archived.
Removing participants from a bookable session group
You can only remove a single participant's booking from a session group via the following:
curl --url <Base URL>/<pid> -u<username>:<password> -H Content-Type:text/xml -X DELETE
- pid - The ID of the participant to remove
By default this will flag the participant as cancelled, but will not do anything with the financial side of the booking. To flag a refund was give or a credit note, you should pass the following:
<refundtype>Refund</refundtype>
or
<refundtype>Credit</refundtype>
This will result in the participants booking being completely being removed from the session group
Making payments to a booking
curl --url <Base URL>/<id> -u<username>:<password> -H Content-Type:text/xml -X PUT -d '<xml>'
- *id* - This is the participant id
The data for submitting a payment record is currently quite basic. It is our intention to expand on this:
<payment> <PaymentType>Debit Card</PaymentType> <PaymentAmount>20</PaymentAmount> </payment>
- PaymentType - This must be one of the following values 'Cash', 'Cheque', 'Debit Card', 'Credit Card', 'Other'
- PaymentAmount - This is an amount in pounds.pence
Confirming/Unconfirming a booking
curl --url <Base URL>/<id> -u<username>:<password> -H Content-Type:text/xml -X PUT -d '<xml>'
- *id* - This is the participant id
The data for submitting a payment record is currently quite basic. It is our intention to expand on this:
<booking> <Confirmed>1</Confirmed> </booking>'
This can also be combined with a payment as such:
<payment> <PaymentType>Debit Card</PaymentType> <PaymentAmount>20</PaymentAmount> <Confirmed>1</Confirmed> </payment>