Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clubspark Example Endpoint #9

Closed
nickevansuk opened this issue Jun 10, 2016 · 8 comments
Closed

Clubspark Example Endpoint #9

nickevansuk opened this issue Jun 10, 2016 · 8 comments
Labels
example Example JSON from an implementation

Comments

@nickevansuk
Copy link
Contributor

nickevansuk commented Jun 10, 2016

Please add to this thread

@nickevansuk nickevansuk modified the milestone: Clubspark [RTPE] Jun 10, 2016
@nickevansuk nickevansuk added the example Example JSON from an implementation label Jul 4, 2016
@nickevansuk
Copy link
Contributor Author

nickevansuk commented Jul 6, 2017

@dolkensp here's a starter for 10:

The below single endpoint will be updated as often as the courses are updated:

http://feature1.api.clubspark.uk/v0/openactive/courses/latest?afterTimestamp=3074260416370&afterID=99c46c55-68ff-4681-aa3a-025f8e1ed979
   ->  { 
          "next": "http://feature1.api.clubspark.uk/v0/openactive/courses/latest?afterTimestamp=3074260416370&afterID=c0a626f0-8778-4916-8b06-00092a3301e7",
          "items": [
            {
              "@context": [
                "https://www.openactive.io/ns/oa.jsonld",
                "https://www.openactive.io/ns-beta/oa.jsonld"
              ],
              "type": "Event", /* The top level event here is a 'course', fields here map to 'course' fields */

              "categories": "Mini Tennis",

              "activity": {
                "id": "http://openactive.io/activity-list/#f2ea7405-6098-4378-b0fe-4e398a659fc4",
                "type": "Concept",
                "prefLabel": "Tennis",
                "inScheme": "https://www.openactive.io/activity-list/activity-list.jsonld"
              }, /* hard coded  */

              "offer": [
                {
                  "type": "Offer",
                  "name": "Full course", /* Hard coded */
                  "identifier": "COURSE", /* Hard coded for override */
                  "price": "60.00", /* fullCourseCost (+ lateJoiningSessionCost if in the past and lateJoiningEnabled) */
                  "priceCurrency": "GBP", /* Hard coded */
                  "url": "", /* url to book */
                },
                {
                  "type": "Offer",
                  "name": "Single session", /* Hard coded */
                  "identifier": "SINGLE", /* Hard coded for override */
                  "price": "6.60", /* perSessionCost (+ lateJoiningSessionCost if in the past and lateJoiningEnabled?) */
                  "priceCurrency": "GBP", /* Hard coded */
                  "url": "", /* url to book */
                }
              ],

              "identifier": "4e2ff99b-1eb7-4da8-af73-016ff914546d",

              "name": "Mini Tennis",

              "ageRange": "10-12",

              "clubspark:theme": "Tots", /* TODO: add to beta? */
              "clubspark:type": "Course", /* TODO: add to beta? */

              "url": "", /* url of course page */

              "organizer": {
                "type": "Organization",
                "identifier": "193a4028-bd3d-48d2-87de-01686d8377c4",
                "name": "Bar Lawn Tennis Society",
                "telephone": "02074215300",
                "email": "jonathanupton@tanfieldchambers.co.uk.ltatest",
                "image": "https://d2tfd645274ffx.cloudfront.net/uploads/photo/image/5736/uploads_2F1407254366636-3u1n55vs7kivygb9-d692e79ec29ae848ff24c0dd960b9245_2FMile%2BEnd%2BLeisure%2BCentre%2BRear%2Bbuiliding%2Band%2Btrack.jpg"
              },

              "location": {
                "type": "Place",
                "identifier": "c0a626f0-8778-4916-8b06-00092a3301e7",
                "name": "Warriston Community Tennis Club",
                "address": {
                  "type": "PostalAddress",
                  "addressLocality": "Edinburgh",
                  "postalCode": "EH3 5LA"
                },
                "geo": {
                  "type": "GeoCoordinates",
                  "latitude": 55.958561,
                  "longitude": -3.20392
                },

                "image": "https://d2tfd645274ffx.cloudfront.net/uploads/photo/image/5736/uploads_2F1407254366636-3u1n55vs7kivygb9-d692e79ec29ae848ff24c0dd960b9245_2FMile%2BEnd%2BLeisure%2BCentre%2BRear%2Bbuiliding%2Band%2Btrack.jpg"

              },

              "programme": "Junior",

              "level": "All", /* Skill level */

              "eventStatus": "http://schema.org/EventScheduled", /* one of "http://schema.org/EventScheduled" (status=Active), "http://schema.org/EventCancelled" (status=Cancelled) */

              "image": "https://d2tfd645274ffx.cloudfront.net/uploads/photo/image/5736/uploads_2F1407254366636-3u1n55vs7kivygb9-d692e79ec29ae848ff24c0dd960b9245_2FMile%2BEnd%2BLeisure%2BCentre%2BRear%2Bbuiliding%2Band%2Btrack.jpg",

              "genderRestriction": "mixed",

              "isCoached": true, /* do you have this? */

              "description": "", 

              "eventSchedule": { /* For e.g. Run Together, where there's a schedule to the course, which is displayed alongside the detailed sessions */ 
                 "type": "Schedule",
                 "startDate": "2017-07-11", /* Start date of schedule */
                 "endDate": "2017-12-31", /* Repeat until this date, do not include this key if "forever". */
                 "frequency": "weekly", /* One of "minutes", "hourly", "daily", "weekly", "monthly", "yearly" */
                 "byDay": ["http://schema.org/Sunday"], /* Array of days of week with 'http://schema.org/' prepended */
                 "startTime": "19:00", /* Start time */
                 "endTime": "20:00", /* End time (if available) */
              },

              "beta:distance": { /* see https://github.com/openactive/ns-beta/issues/3 */
                "range": "0-5",
                "unitCode": "KMT"
              },

              "leader": [ /* Run Leaders for run together */
                {
                  "type": "Person",
                  "name": "Anthony Norris",
                  "jobTitle": "Group Leader, Run Leader",
                  "image": "https://d2tfd645274ffx.cloudfront.net/uploads/photo/image/5736/uploads_2F1407254366636-3u1n55vs7kivygb9-d692e79ec29ae848ff24c0dd960b9245_2FMile%2BEnd%2BLeisure%2BCentre%2BRear%2Bbuiliding%2Band%2Btrack.jpg",
                },
                {
                  "type": "Person",
                  "name": "Alison Harrow",
                  "jobTitle": "Run Leader Mentor, Group Leader",
                  "image": "https://d2tfd645274ffx.cloudfront.net/uploads/photo/image/5736/uploads_2F1407254366636-3u1n55vs7kivygb9-d692e79ec29ae848ff24c0dd960b9245_2FMile%2BEnd%2BLeisure%2BCentre%2BRear%2Bbuiliding%2Band%2Btrack.jpg",
                }
              ],

              "subEvent": [ /* each session is a subEvent */
                {
                  "start": "2015-06-30T08:30:00Z", /* note best UTC without timezone */
                  "end": "2015-06-30T11:30:00Z", /* note best UTC without timezone */
                  "duration": "PT60M", /* Duration converted to ISO spec. Can do this with e.g. System.Xml.XmlConvert.ToString(TimeSpan.FromMinutes(ClassDuration)) */

                  "identifier": "9107cd54-7e89-405c-8c2b-026988099ff8",
                  "location": { /* Include if overriden */
                    "type": "Place",
                    "identifier": "c0a626f0-8778-4916-8b06-00092a3301e7",
                    "name": "Warriston Community Tennis Club",
                    "address": {
                      "type": "PostalAddress",
                      "addressLocality": "Edinburgh",
                      "postalCode": "EH3 5LA"
                    },
                    "geo": {
                      "latitude": 55.958561,
                      "longitude": -3.20392
                    }
                  },
                  "name": "group 1 classes",
                  "description": "", 
                  "eventStatus": "http://schema.org/EventScheduled", /* one of "http://schema.org/EventScheduled" (status=Active), "http://schema.org/EventCancelled" (status=Cancelled) */

                  "maximumAttendeeCapacity": 20,

                  "url": "", /* url of session page */

                  "offer": {
                    "type": "Offer",
                    "name": "Single session", /* Hard coded */
                    "identifier": "SINGLE", /* Hard coded for override */
                    "price": "6.00", /* single session cost */
                    "priceCurrency": "GBP", /* Hard coded */
                    "url": "", /* url to book */
                  },
                }
              ]
            }
          ],
          "license": "https://creativecommons.org/licenses/by/4.0/"
      }

For availability, as bookings occur more frequently, this separate endpoint covers availability:

http://feature1.api.clubspark.uk/v0/openactive/bookings/latest?afterTimestamp=3074260416370&afterID=99c46c55-68ff-4681-aa3a-025f8e1ed979
   ->  { 
          "next": "http://feature1.api.clubspark.uk/v0/openactive/bookings/latest?afterTimestamp=3074260416370&afterID=c0a626f0-8778-4916-8b06-00092a3301e7",
          "items": [
            {
              "state": "updated",
              "kind": "bookedOccurrence",
              "id": "c0a626f0-8778-4916-8b06-00092a3301e7", /* Session ID */
              "modified": 1394891514, 
              "data": {
                "@context": "https://www.openactive.io/ns/oa.jsonld",
                "type": "Event",

                "superEvent": {
                  "identifier": "9107cd54-7e89-405c-8c2b-026988099ff8" /* Course ID */
                },

                "identifier": "c0a626f0-8778-4916-8b06-00092a3301e7", /* Session ID */

                "startDate": "2017-07-25T19:00:00Z",
                "endDate": "2017-07-25T20:00:00Z",
                "remainingAttendeeCapacity": 4, /* Number of spaces remaining */
              }
            }
          ],
          "license": "https://creativecommons.org/licenses/by/4.0/"
        }

@peter-dolkens
Copy link
Collaborator

peter-dolkens commented Jul 10, 2017

Here is the current sample I have working.

Still need to confirm some pricing logic with the team.

courses.json.txt

Haven't got the bookings feed running just yet.

Added the eligibleCustomerType property to Offers where necessary to indicate when member-only pricing was supplied.

@nickevansuk
Copy link
Contributor Author

Looks good! In terms of eligibleCustomerType, http://purl.org/goodrelations/ (referenced from schema.org) doesn't seem to have adequate vocab for this. Suggest we add terms to beta, e.g.

Let me know the list of terms you've used - Member is a great one - and I can add them to Beta (or please do so via https://github.com/openactive/ns-beta/issues).

One other point to note: there aren't any URLs in the events or offers as yet...

@peter-dolkens
Copy link
Collaborator

peter-dolkens commented Jul 10, 2017

I've just used "Member" here as a generic term, but I'd also consider just using the name of the specific Membership Packages (which are user defined) for this value.

So "Members", "Everyone", "Administrators" might be common generic terms based on our current uses, but "2017 Junior Membership" might be an example of a more specific term.

I don't believe we offer this package-specific pricing scheme for Courses currently, but we certainly do for other parts of the system, such as court-access bookings; So it's believable that it may come to courses in the future.

And yes, I'm aware I haven't filled in URLs just yet. Will be speaking with the team about the expected landing pages for these.

@peter-dolkens
Copy link
Collaborator

peter-dolkens commented Jul 10, 2017

Here is the pricing configuration for court bookings, where you can see the different values available for a single club:

image

Everyone, All Members, and Booking Administrators are all System values, the rest are user-controlled.

Of note - Responsibilities are admin-assigned, not something a user would ever sign up for, so they won't have a "Url" as such.

Memberships can generally be bought/signed up to.

Groups are system-defined currently.

@nickevansuk
Copy link
Contributor Author

Very interesting @dolkensp - perhaps we stick to just "https://www.openactive.io/ns-beta#Member" for now to distinguish them from non member offers?

Representing membership purchase options certainly something to think about in the future, for now it is sufficient to mark offers as "member only" in this way, and then provide a URL in the offer that takes you to the membership purchase screen (for all membership types).

@peter-dolkens
Copy link
Collaborator

Another thing that may affect this - member pricing may end up being redacted - I'll need to check with the team on that, as some venues may not want their pricing structure exposed if we do allow the more complex pricing logic.

@nickevansuk
Copy link
Contributor Author

That makes sense - probably not relevant to publish full member pricing, but rather just a "From £5" type of thing with a link to find out more about membership. The point of publishing member pricing is for an upsell option, rather than for the user to get granular understanding of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
example Example JSON from an implementation
Projects
None yet
Development

No branches or pull requests

2 participants