|
48 | 48 | }],
|
49 | 49 |
|
50 | 50 | otherLinks: [{
|
51 |
| - key: "Repo", |
52 |
| - value: "We are on Github", |
53 |
| - href: "https://github.com/openactive/open-booking-api/", |
54 |
| - class: "repo" |
55 |
| - }, { |
56 |
| - key: "Issues", |
57 |
| - value: "Report an issue", |
58 |
| - href: "https://github.com/openactive/open-booking-api/issues/" |
59 |
| - }, { |
60 | 51 | key: "Version",
|
61 |
| - value: "1.0" |
| 52 | + value: "1.0", |
| 53 | + href: "https://github.com/openactive/open-booking-api/issues/" |
62 | 54 | }],
|
63 | 55 |
|
64 | 56 | logos: [{
|
|
1072 | 1064 | | [`oa:allowSimpleCancellation`](https://openactive.io/allowSimpleCancellation) | - | RECOMMENDED | [`schema:Boolean`](https://schema.org/Boolean) | Whether the event can be cancelled. |
|
1073 | 1065 | | [`oa:unitTaxSpecification`](https://openactive.io/unitTaxSpecification) | - | REQUIRED | Array of [`oa:TaxChargeSpecification`](https://openactive.io/TaxChargeSpecification) | Breakdown of tax payable for the OrderItem. |
|
1074 | 1066 | | [`schema:acceptedOffer`](http://schema.org/acceptedOffer) | REQUIRED | REQUIRED | [`schema:Offer`](https://schema.org/Offer) | The offer from the associated `orderedItem` that has been selected by the **Customer**. |
|
1075 |
| -| [`schema:orderedItem`](http://schema.org/orderedItem) | REQUIRED | REQUIRED | [`oa:ScheduledSession`](https://openactive.io/ScheduledSession), [`oa:Slot`](https://openactive.io/Slot), [`oa:HeadlineEvent`](https://openactive.io/HeadlineEvent), [`schema:Event`](https://schema.org/Event) or [`schema:CourseInstance`](https://schema.org/CourseInstance) | The specific bookable Thing that has been selected by the **Customer**. See the [Modelling Specification](https://www.openactive.io/modelling-opportunity-data/) for more information on these types. | |
| 1067 | +| [`schema:orderedItem`](http://schema.org/orderedItem) | REQUIRED | REQUIRED | [`oa:ScheduledSession`](https://openactive.io/ScheduledSession), [`oa:Slot`](https://openactive.io/Slot), [`oa:HeadlineEvent`](https://openactive.io/HeadlineEvent), [`schema:Event`](https://schema.org/Event) or [`schema:CourseInstance`](https://schema.org/CourseInstance) | The specific bookable Thing that has been selected by the **Customer**. See the [[!Modelling-Opportunity-Data]] for more information on these types. | |
1076 | 1068 |
|
1077 | 1069 | Note that [`schema:orderQuantity`](http://schema.org/orderQuantity) is not supported in this version of the specification.
|
1078 | 1070 |
|
1079 | 1071 |
|
1080 | 1072 | ## `Offer`
|
1081 | 1073 |
|
1082 |
| -Use of properties of `Offer` defined in the [Modelling Specification](https://www.openactive.io/modelling-opportunity-data/) are also encouraged. |
| 1074 | +Use of properties of `Offer` defined in the [[!Modelling-Opportunity-Data]] are also encouraged. |
1083 | 1075 |
|
1084 | 1076 | | Property | Broker Request | Booking System Response | Type | Notes |
|
1085 | 1077 | |--------------------------------------------------------------------|----------|----------|-|------|
|
|
1355 | 1347 | </section>
|
1356 | 1348 |
|
1357 | 1349 |
|
1358 |
| - <section class="normative"> |
| 1350 | +<section class="normative"> |
| 1351 | +# Endpoints |
| 1352 | + |
| 1353 | +This API has been defined around the concept of URL discovery. This |
| 1354 | +allows resource URLs which match the naming conventions of each **Booking System**. |
| 1355 | + |
| 1356 | +# Paths and Verbs |
| 1357 | + |
| 1358 | +Due to URL discovery, the paths of the endpoints below are illustrative, as the actual paths may vary provided they are consistent within an implementation. |
| 1359 | + |
| 1360 | +| Name | Status | Resource | HTTP Verb | Example Path | |
| 1361 | +|------------------------|-------------|------------------|-----------|--------------------------------------------------| |
| 1362 | +| Order Creation | REQUIRED | Order collection | POST | `/orders` | |
| 1363 | +| Order Feed | REQUIRED | RPDE feed | GET | `/orders-rpde` | |
| 1364 | +| OrderItem Cancellation | REQUIRED | OrderItem | PATCH | `/orders/{order-id}/order-items/{order-item-id}` | |
| 1365 | +| Order Cancellation | RECOMMENDED | Order | PATCH | `/orders/{order-id}` | |
| 1366 | +| Order Status | OPTIONAL | Order | GET | `/orders/{order-id}` | |
| 1367 | + |
| 1368 | +## URL discovery |
| 1369 | + |
| 1370 | +The URL for the initial Order Creation action may be discovered by parsing the |
| 1371 | +actions defined in the `potentialAction` property of an object and constructing the appropriate URL from the |
| 1372 | +`urlTemplate` property of the `schema:EntryPoint` object contained within the `target` |
| 1373 | +property of the `potentialAction` required. |
| 1374 | + |
| 1375 | +An example is below: |
| 1376 | + |
| 1377 | +<pre class="example" title="Example of a potentialAction"> |
| 1378 | + |
| 1379 | +"potentialAction": [ |
| 1380 | + { |
| 1381 | + "type": "PayAction", |
| 1382 | + "name": "Payment", |
| 1383 | + "target": { |
| 1384 | + "type": "EntryPoint", |
| 1385 | + "urlTemplate": "https://example.com/orders", |
| 1386 | + "encodingType": "application/vnd.openactive.v1.0+json", |
| 1387 | + "httpMethod": "POST" |
| 1388 | + } |
| 1389 | + } |
| 1390 | + ] |
| 1391 | +</pre> |
| 1392 | + |
| 1393 | +Since discovery of URLs is an implicit part of the specification, **brokers** |
| 1394 | +SHOULD avoid hard-coding URLs for specific actions into their applications and |
| 1395 | +client libraries. **Brokers** SHOULD use most applicable URL discovered at the |
| 1396 | +point in the workflow they are currently in - e.g. not use a cached URL that has |
| 1397 | +been previously successfully used. They should also not attempt to create URLs |
| 1398 | +for a specific action based on patterns within previously used URLs. |
| 1399 | + |
| 1400 | +It is the responsibility of **booking platforms** to advertise the URL for |
| 1401 | +further activity in the booking workflow at the point of need. For example they |
| 1402 | +MUST advertise the URL for `Order` creation when a **broker** requests |
| 1403 | +a specific **opportunity** resource and SHOULD advertise it in their RDPE feeds |
| 1404 | +since both of these points within the booking workflow are places where a \ |
| 1405 | +**customer** may wish to check availability. |
| 1406 | + |
| 1407 | +### Dataset site examples |
| 1408 | + |
| 1409 | +<pre class="example" title="Example of Dataset site embedded JSON-LD"> |
| 1410 | + |
| 1411 | +<script type="application/ld+json"> |
| 1412 | + { |
| 1413 | + "@context": "https://schema.org", |
| 1414 | + "keywords": [ |
| 1415 | + "Sessions", |
| 1416 | + "Facilities", |
| 1417 | + "Activities", |
| 1418 | + "Sports", |
| 1419 | + "Physical Activity", |
| 1420 | + "OpenActive" |
| 1421 | + ], |
| 1422 | + "license": "https://creativecommons.org/licenses/by/4.0/", |
| 1423 | + "distribution": [ |
| 1424 | + { |
| 1425 | + "additionalType": "https://openactive.io/SessionSeries", |
| 1426 | + "encodingFormat": "application/vnd.openactive.rpde+json; version=1.0", |
| 1427 | + "contentUrl": "https://opendata.leisurecloud.live/api/feeds/fusion-lifestyle-live-session-series", |
| 1428 | + "@type": "DataDownload", |
| 1429 | + "name": "SessionSeries" |
| 1430 | + }, |
| 1431 | + { |
| 1432 | + "additionalType": "https://openactive.io/ScheduledSession", |
| 1433 | + "encodingFormat": "application/vnd.openactive.rpde+json; version=1.0", |
| 1434 | + "contentUrl": "https://opendata.leisurecloud.live/api/feeds/fusion-lifestyle-live-scheduled-sessions", |
| 1435 | + "@type": "DataDownload", |
| 1436 | + "name": "ScheduledSession" |
| 1437 | + }, |
| 1438 | + { |
| 1439 | + "additionalType": "https://openactive.io/FacilityUse", |
| 1440 | + "encodingFormat": "application/vnd.openactive.rpde+json; version=1.0", |
| 1441 | + "contentUrl": "https://opendata.leisurecloud.live/api/feeds/fusion-lifestyle-live-facility-uses", |
| 1442 | + "@type": "DataDownload", |
| 1443 | + "name": "FacilityUse" |
| 1444 | + }, |
| 1445 | + { |
| 1446 | + "additionalType": "https://openactive.io/Slot", |
| 1447 | + "encodingFormat": "application/vnd.openactive.rpde+json; version=1.0", |
| 1448 | + "contentUrl": "https://opendata.leisurecloud.live/api/feeds/fusion-lifestyle-live-slots", |
| 1449 | + "@type": "DataDownload", |
| 1450 | + "name": "Slot" |
| 1451 | + } |
| 1452 | + ], |
| 1453 | + "discussionUrl": "https://github.com/fusion-lifestyle/opendata/issues", |
| 1454 | + "documentation": "https://docs.leisurecloud.live/", |
| 1455 | + "inLanguage": "en-GB", |
| 1456 | + "publisher": { |
| 1457 | + "legalName": "Fusion Lifestyle", |
| 1458 | + "logo": { |
| 1459 | + "@type": "ImageObject", |
| 1460 | + "url": "https://res.cloudinary.com/gladstone/image/upload/fusion-lifestyle-live/wfiqlyqy5sjfpo5b6dsl" |
| 1461 | + }, |
| 1462 | + |
| 1463 | + "@type": "Organization", |
| 1464 | + "name": "Fusion Lifestyle", |
| 1465 | + "description": "Fusion Lifestyle was established in April 2000 following a decision by a London Borough Council to outsource the management of the leisure facilities. Fusion now manages a diverse portfolio of facilities using our specialist expertise to provide sustainable solutions for councils and exciting products and programmes for our customers. Fusion is a national operator managing leisure facilities from Wales to London and as far north as Newcastle. \n\nNo two Fusion sites are the same, we retain the heritage of centres when we refurbish and we are experienced at managing centres from ice rinks to outward bound residential centres, town halls and expansive leisure facilities. We put our energies into providing facilities and programmes that are an attractive proposition to the local community. We respect the history of our centres and it is not uncommon for generations of local residents to hold fond memories of learning to swim in our centres, playing football matches over the years and hosting birthday celebrations at our sites.\n\nFusion is a registered charity, there are therefore no shareholders. We are able to continually reinvest in facilities, products and importantly people.\n", |
| 1466 | + "url": "https://www.fusion-lifestyle.com/" |
| 1467 | + }, |
| 1468 | + "datePublished": "2019-02-20T13:22:28.7743707Z", |
| 1469 | + "schemaVersion": "https://www.openactive.io/modelling-opportunity-data/2.0/", |
| 1470 | + "softwareVersion": "OWS:2.0.1", |
| 1471 | + "@type": "Dataset", |
| 1472 | + "id": "https://fusionopendata.fusion-lifestyle.com/OpenActive/", |
| 1473 | + "name": "Fusion Lifestyle Sessions and Facilities", |
| 1474 | + "description": "Near real-time availability and rich descriptions relating to the sessions and facilities available from Fusion Lifestyle, published using the OpenActive Modelling Specification 2.0, and covering a rolling lookhead window of the next 14 days.", |
| 1475 | + "url": "https://fusionopendata.fusion-lifestyle.com/OpenActive/" |
| 1476 | +} |
| 1477 | +</script> |
| 1478 | + |
| 1479 | +</pre> |
| 1480 | + |
| 1481 | + |
| 1482 | +</section> |
| 1483 | + |
| 1484 | + |
| 1485 | +<section class="normative"> |
1359 | 1486 | # Common Requirements
|
1360 | 1487 |
|
1361 | 1488 | This section defines some common functionality that applies to the design of the
|
|
1373 | 1500 | Media types will conform to the following pattern:
|
1374 | 1501 |
|
1375 | 1502 | ```
|
1376 |
| -application/vnd.openactive[.version]+json |
| 1503 | +application/vnd.openactive.booking+json; version=[version] |
1377 | 1504 | ```
|
1378 | 1505 |
|
1379 | 1506 | The current media type is:
|
1380 | 1507 |
|
1381 | 1508 | ```
|
1382 |
| -application/vnd.openactive.1.0+json |
| 1509 | +application/vnd.openactive.booking+json; version=1.0 |
1383 | 1510 | ```
|
1384 | 1511 |
|
1385 | 1512 | **Brokers** specifying a media type without a version, such as:
|
1386 | 1513 |
|
1387 | 1514 | ```
|
1388 |
| -application/vnd.openactive+json |
| 1515 | +application/vnd.openactive.booking+json |
1389 | 1516 | ```
|
1390 | 1517 |
|
1391 |
| -will recieve data in in the most current format which is 1.0. |
| 1518 | +will receive data in in the most current format which is 1.0. |
1392 | 1519 |
|
1393 | 1520 | If you are building an application as a **broker** and care about the stability
|
1394 | 1521 | of the response, or have a client application which is tied to a specific
|
|
1399 | 1526 | that when the Booking API reaches the stability of a 1.0 version that this
|
1400 | 1527 | advice may change.
|
1401 | 1528 |
|
| 1529 | +<div class="issue" data-number="93"></div> |
| 1530 | + |
1402 | 1531 |
|
1403 | 1532 | ## Response formats
|
1404 | 1533 |
|
|
1410 | 1539 |
|
1411 | 1540 | <pre class="example" title="minimal JSON-LD document">
|
1412 | 1541 | {
|
1413 |
| - "@context": "https://openactive.io/ns/oa.jsonld" |
| 1542 | + "@context": "https://openactive.io/" |
1414 | 1543 | }
|
1415 | 1544 | </pre>
|
1416 | 1545 |
|
1417 | 1546 | Unless otherwise specified the request and response documents MUST conform to
|
1418 | 1547 | the [[!Modelling-Opportunity-Data]] data model.
|
1419 | 1548 |
|
1420 |
| -## URL discovery |
1421 |
| - |
1422 |
| -The Booking API has been defined around the concept of URL discovery. This |
1423 |
| -allows **booking systems** to create resource URLs which match their own |
1424 |
| -terms for naming specific objects such as **events** and **orders**. |
1425 |
| - |
1426 |
| -The URL for a specific action, such as for example providing **payment** details, |
1427 |
| -may be discovered by parsing the actions defined in the `potentialAction` |
1428 |
| -property of an object and constructing the appropriate URL from the |
1429 |
| -`urlTemplate` property of the `schema:EntryPoint` object contained within the `target` |
1430 |
| -property of the `potentialAction` required. |
1431 |
| - |
1432 |
| -An example is below: |
1433 |
| - |
1434 |
| -<pre class="example" title="Example of a potentialAction"> |
1435 |
| - |
1436 |
| -"potentialAction": [ |
1437 |
| - { |
1438 |
| - "type": "PayAction", |
1439 |
| - "name": "Payment", |
1440 |
| - "target": { |
1441 |
| - "type": "EntryPoint", |
1442 |
| - "urlTemplate": "https://example.com/orders", |
1443 |
| - "encodingType": "application/vnd.openactive.v1.0+json", |
1444 |
| - "httpMethod": "PATCH" |
1445 |
| - } |
1446 |
| - } |
1447 |
| - ] |
1448 |
| -</pre> |
1449 |
| - |
1450 |
| -Since discovery of URLs is an implicit part of the specification, **brokers** |
1451 |
| -SHOULD avoid hard-coding URLs for specific actions into their applications and |
1452 |
| -client libraries. **Brokers** SHOULD use most applicable URL discovered at the |
1453 |
| -point in the workflow they are currently in - e.g. not use a cached URL that has |
1454 |
| -been previously successfully used. They should also not attempt to create URLs |
1455 |
| -for a specific action based on patterns within previously used URLs. |
1456 |
| - |
1457 |
| -It is the responsibility of **booking platforms** to advertise the URL for |
1458 |
| -further activity in the booking workflow at the point of need. For example they |
1459 |
| -MUST advertise the URL for `Order` creation when a **broker** requests |
1460 |
| -a specific **opportunity** resource and SHOULD advertise it in their RDPE feeds |
1461 |
| -since both of these points within the booking workflow are places where a \ |
1462 |
| -**customer** may wish to check availability. |
1463 |
| - |
1464 | 1549 |
|
1465 | 1550 | ## Error handling
|
1466 | 1551 |
|
|
0 commit comments