### Starting the Sample WebSocket Broker Source: https://developer.sabre.com/sdk/sabre-red/26.3/help-documentation/migration_native_api_to_websockets.html These commands are used to install dependencies and start the sample STOMP broker provided in the SDK for development and testing purposes. ```bash cd redapp/referenceplugins/com.sabre.redapp.example3.web.websockets/WSBroker npm install node app.js ``` -------------------------------- ### Get Booking Accounting Items Example Source: https://developer.sabre.com/rest-api/booking-management-api/v1/release-notes/update/1.24-August-6-2024.html Example of accounting items in the Get Booking response, including creation type and other financial details. ```json { "airlineCode": "LO", "commission": { "commissionAmount": "0.00" }, "creationType": "First Issuance", "fareAmount": "1512.00", "fareApplicationType": "Single Traveler", "formOfPaymentType": "Cash", "tariffBasisType": "Domestic", "taxAmount": "296.43", "ticketNumber": "0806802005062", "travelerIndices": [ 1 ] } ``` ```json { "airlineCode": "LO", "commission": { "commissionAmount": "0.00" }, "creationType": "Exchange", "fareAmount": "0.00", "fareApplicationType": "Single Traveler", "formOfPaymentType": "Cash", "tariffBasisType": "Domestic", "taxAmount": "0.00", "ticketNumber": "0806802005063", "travelerIndices": [ 1 ] } ``` -------------------------------- ### Get Booking Payment Trip Type Example Source: https://developer.sabre.com/rest-api/booking-management-api/v1/release-notes/update/1.24-August-6-2024.html Example of a payment form within the Get Booking response, showing trip type. ```json { "tripType": "Family", "type": "CASH" } ``` -------------------------------- ### Start Web Module Development Server Source: https://developer.sabre.com/sdk/sabre-red/26.3/help-documentation/web-red-app-running.html Run this command in the Web Module directory to build and serve the module locally. The server listens on http://localhost:8080 by default. It indicates success with a 'READY' status and failure with 'FAILURE'. Stop the process with CTRL+C. ```bash 1ngv run [--port port] ``` -------------------------------- ### Navigate Through Queue with Action QXR Source: https://developer.sabre.com/soap-api/access-queue/2.1.1/release-notes/update/2.0.8-March-23-2017.html This example demonstrates how to use the Navigation/@Action parameter to navigate through a queue. The 'QXR' enumeration is used for this purpose. ```xml 1 ``` -------------------------------- ### Get Booking Payment Form Example Source: https://developer.sabre.com/rest-api/booking-management-api/v1/release-notes/update/1.24-August-6-2024.html Example of a payment form within the Get Booking response, including card details and use type. ```json { "cardNumber": "4XXXXXXXXXXX1111", "cardTypeCode": "VI", "expiryDate": "2024-12", "type": "PAYMENTCARD", "useType": "Low-Cost Carrier" } ``` -------------------------------- ### Get Booking Agency Payment Card Example Source: https://developer.sabre.com/rest-api/booking-management-api/v1/release-notes/update/1.24-August-6-2024.html Example of a payment form in Get Booking response, indicating an agency payment card with full cardholder details. ```json { "cardHolder": { "address": { "city": "Dallas", "countryCode": "US", "postalCode": "30-415", "street": "SabreDrive" }, "email": "john.doe@sabre.com", "givenName": "John", "phone": "737747767", "surname": "Doe" }, "cardNumber": "4XXXXXXXXXXX1111", "cardTypeCode": "VI", "corporateId": "77777", "expiryDate": "2024-12", "isAgencyPaymentCard": true, "tripType": "Unknown", "type": "PAYMENTCARD", "useType": "Unknown" } ``` -------------------------------- ### Initialize Web Module with ngv CLI Source: https://developer.sabre.com/sdk/sabre-red/26.3/help-documentation/web-red-app-creating.html Run this command in your desired directory to start the Web Module creation process. Follow the wizard prompts for configuration. ```bash ngv init ``` -------------------------------- ### Get Seats NDC Request Example Source: https://developer.sabre.com/rest-api/get-seats-agency/3.0/examples/get-seats-v3/get-seats-ndc-order-id.html This is an example of a Get Seats NDC request payload using an Order ID. Ensure the order ID is valid and belongs to your account. ```json 1{ "orderId" : "1SXXXIJ62FWMO" } ``` -------------------------------- ### Sample Service Implementation Source: https://developer.sabre.com/sdk/sabre-red/26.3/help-documentation/webmodules_com_sabre_redapp_example3_desktop_template.html This Java class extends AbstractService and implements ISampleService. It declares a SERVICE_NAME constant and includes a method to execute a command using the command framework. ```java package com.sabre.redapp.example3.desktop.template.src.com.sabre.redapp.example3.web.template.service.impl; import com.sabre.redapp.example3.desktop.template.src.com.sabre.redapp.example3.web.template.service.ISampleService; import com.sabre.redapp.example3.desktop.template.src.com.sabre.redapp.example3.web.template.service.SampleService; import com.sabre.redapp.example3.desktop.template.src.com.sabre.redapp.example3.web.template.service.impl.AbstractService; public class TemplateFlowExtPointServiceImpl extends AbstractService implements ISampleService { public static final String SERVICE_NAME = "SampleService"; @Override public void executeCommand(String command) { // (1) SampleService extends AbstractService and implements ISampleService. (2) Declare variable SERVICE_NAME with service name. (3) executeCommand invoking command framework with command ’*A’. cf('*A').send(); // (3) } } ``` -------------------------------- ### Sample Plugin Directory Structure Source: https://developer.sabre.com/sdk/sabre-red/26.3/help-documentation/webmodules_com_sabre_redapp_example3_desktop_template.html This is a tree representation of a sample plugin's directory structure, showing all configuration, source, and web files. ```bash $ tree com.sabre.redapp.example3.desktop.template com.sabre.redapp.example3.desktop.template/ ├── build.properties ├── META-INF │   └── MANIFEST.MF ├── OSGI-INF │   └── TemplateFlowExtPointService.xml ├── plugin.xml ├── pom.xml ├── redapp.xml ├── src │   ├── com │   │   └── sabre │   │   └── redapp │   │   └── example3 │   │   └── web │   │   └── template │   │   ├── data │   │   │   ├── Flight.java │   │   │   └── ObjectFactory.java │   │   │   └── SampleFlights.java │   │   └── service │   │   ├── impl │   │   │   └── TemplateFlowExtPointServiceImpl.java │   │   └── TemplateFlowExtPointService.java │   └── transformer.properties └── web-src └── com-sabre-redapp-example-desktop-template ├── concierge.conf.js ├── package.json └── src ├── assets │   └── sabre-logo.png ├── code │   ├── Context.ts │   ├── index.ts │   ├── Main.ts │   ├── models │   │   ├── FlightModel.ts │   │   └── SampleFlightsModel.ts │   ├── services │   │   ├── ISampleService.ts │   │   └── SampleService.ts │   └── views │   ├── FlightAction.ts │   ├── FlightDrawer.ts │   ├── FlightExpert.ts │   ├── FlightExpertRow.ts │   ├── FlightNovice.ts │   ├── FlightNoviceRow.ts │   └── SampleFlightsView.ts ├── guides │   └── README.md ├── i18n │   └── en_US │   └── translations.json ├── manifest.json ├── styles │   └── styles.less └── templates ├── FlightAction.html ├── FlightExpert.html ├── FlightExpertRow.html ├── FlightNovice.html └── FlightNoviceRow.html ``` -------------------------------- ### Get Reservation Response Source: https://developer.sabre.com/guide/api-specific-samples/api-specific-samples.html This is an example of a successful response from the Get Reservation API, detailing booking information, passenger details, and more. ```xml 1 2 3 4 OQFZFY 5 2024-06-05T07:20:00 6 2024-06-05T07:20:00 7 HSQ 8 2024-06-05T07:20:18 9 1 10 11 12 2024-06-27T00:00:00 13 b1eAjlPN02zvzsr+xO+IY2rI3bvUtu28kYHK3MsbdgOz2lOjE/At9w== 14 false 15 false 16 17 18 19 20 21 22 23 FERNANDOWSKI 24 JOY 25 26 27 28 P 29 PT 30 1234567890 31 PT 32 1987-01-01 33 M 34 2030-11-20 35 FERNANDOWSKI 36 JOY 37 38 true 39 40 HK ``` -------------------------------- ### Complete Sample Editor Implementation Source: https://developer.sabre.com/sdk/sabre-red/26.3/help-documentation/addstatuslineforeditors.html This is a full example of a SampleEditor class that extends AbstractAppEditor, including the createPartControl and initializeStatusLine methods with status line contributions. ```java package com.sabre.redapp.example.statusbar; import org.eclipse.jface.action.IStatusLineManager; import org.eclipse.jface.action.Separator; import org.eclipse.jface.action.StatusLineContributionItem; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; import org.eclipse.ui.IActionBars; import com.sabre.edge.platform.core.editor.editors.AbstractAppEditor; public class SampleEditor extends AbstractAppEditor { public void createPartControl(Composite parent) { Label label = new Label(parent, SWT.NONE); label.setText("Sample Editor"); parent.setLayout(new FillLayout()); initializeStatusLine(); } private void initializeStatusLine() { IActionBars actionBars = getEditorSite().getActionBars(); IStatusLineManager statusLineManager = actionBars.getStatusLineManager(); statusLineManager.setMessage("Simple Editor status message"); StatusLineContributionItem modeContributionItem = new StatusLineContributionItem("mode"); modeContributionItem.setText("Simple Editor mode"); statusLineManager.add(modeContributionItem); statusLineManager.add(new Separator()); actionBars.updateActionBars(); } } ``` -------------------------------- ### Get Seats v3 Response Example Source: https://developer.sabre.com/rest-api/get-seats-airline/3.0/examples/get-seats-v3/byreservationpayload_2pax_2seg.html This is a response example for the /byReservationPayload endpoint. It details the seat map and availability for the requested reservation. ```json { "seatMap": { "segments": [ { "segmentId": "string", "flightNumber": "string", "departureAirport": "string", "arrivalAirport": "string", "departureDateTime": "string", "arrivalDateTime": "string", "aircraftType": "string", "seatRows": [ { "rowNumber": "string", "seats": [ { "seatNumber": "string", "seatType": "string", "isAvailable": true, "passengerId": "string" } ] } ] } ], "seatAvailability": { "totalSeats": "string", "availableSeats": "string", "occupiedSeats": "string" } } } ``` -------------------------------- ### EnvironmentPublicService - Acquiring and Using Source: https://developer.sabre.com/sdk/sabre-red/26.3/help-documentation/environmentPublicService.html Demonstrates how to import, obtain, and use the EnvironmentPublicService to get runtime information. ```APIDOC ## Acquiring EnvironmentPublicService In order to obtain EnvironmentPublicService and use it, you need to import it. ```typescript import {EnvironmentPublicService} from 'sabre-ngv-app/app/services/impl/EnvironmentPublicService'; ``` Then obtain the service inside your source as below: ```typescript const environmentPublicService: EnvironmentPublicService = getService(EnvironmentPublicService); ``` ## Available methods ### getRuntime ```typescript getRuntime(): string; ``` Returns in what platform Sabre Red RedApp is running on - desktop, web or mobile. ### Example Usage You can see example usage in **com.sabre.redapp.example3.web.customworkflow** sample. ``` -------------------------------- ### Get Seats v3 Request Example Source: https://developer.sabre.com/rest-api/get-seats/3.0/examples/get-seats-v3/byreservationpayload_2pax_2seg.html This is an example request payload for the /byReservationPayload endpoint. It is used to retrieve seat information for a reservation. ```json { "reservation": { "reservationItems": [ { "itemType": "SEGMENT", "segment": { "flight": { "carrierCode": "AA", "flightNumber": "123", "departure": { "airportCode": "LAX", "date": "2023-10-26" }, "arrival": { "airportCode": "JFK", "date": "2023-10-26" } } } }, { "itemType": "SEGMENT", "segment": { "flight": { "carrierCode": "AA", "flightNumber": "456", "departure": { "airportCode": "JFK", "date": "2023-10-27" }, "arrival": { "airportCode": "LAX", "date": "2023-10-27" } } } } ], "passengers": [ { "passenger": { "firstName": "John", "lastName": "Doe" } }, { "passenger": { "firstName": "Jane", "lastName": "Smith" } } ] } } ``` -------------------------------- ### Example RatePlanType Usage Source: https://developer.sabre.com/soap-api/get-hotel-details-soap/5.0.0/release-notes/update/5.0.0-June-30-2023.html This example demonstrates how to set the RatePlanType parameter. Ensure your integration can handle the RatePlanTypeDescription for new rates. ```text 1RatePlanType="13" ``` -------------------------------- ### Get Seats v3 Request Example Source: https://developer.sabre.com/rest-api/get-seats/3.0/examples/get-seats-v3/bypnrlocator.html This is a request example for the /byPnrLocator endpoint. It specifies the PNR locator for retrieving seat information. ```json { "pnrLocator": "BREDXC" } ``` -------------------------------- ### SOAP Bed Types Example (Multiple Configurations) Source: https://developer.sabre.com/product-collection/content-services-for-lodging-csl/v1/help-documentation/product-normalization.html SOAP example for multiple bed type configurations, each with a count. ```xml ``` -------------------------------- ### Get ATK Token Example Source: https://developer.sabre.com/rest-api/get-hotel-avail/v2.1 Example response from the OAuth Token Create API showing how to obtain an access token (ATK). ```json 1{ 2 "access_token": "T1R6our4IiNS18i*********+CtL0CJhi5gPXkmBLq6TZjs7zNxfUg**", 3 "token_type": "bearer", 4 "expires_in": 604800 5} ``` -------------------------------- ### Get Booking Request with Simple Filter Source: https://developer.sabre.com/rest-api/booking-management-api/v1/help-documentation/get-booking-examples.html Example of a Get Booking request using the 'returnOnly' filter to retrieve specific data, in this case, 'TRAVELERS'. ```json { "confirmationId": "XXXX", "returnOnly": [ "TRAVELERS" ] } ``` -------------------------------- ### ISoapApiService - Acquiring and Using the Client Source: https://developer.sabre.com/sdk/sabre-red/26.3/help-documentation/SoapApi.html Instructions on how to import and obtain an instance of the `ISoapApiService`. ```APIDOC ## Acquiring Sabre SOAP API client In order to obtain Sabre SOAP API client and use it you need to import it: ```typescript import {ISoapApiService} from "sabre-ngv-communication/interfaces/ISoapApiService"; ``` Then obtain the service inside your source as below: ```typescript const soapApi: ISoapApiService = getService(ISoapApiService); ``` ``` -------------------------------- ### Sample API and Implementation Version Headers Source: https://developer.sabre.com/guide/rpc/rpc.html Example HTTP response headers indicating the API version and implementation version of a service. ```http X-API-Version: 1.2 ``` ```http X-Implementation-Version: 1.2.15-alpha ``` -------------------------------- ### Get Vehicle Policy - Location Code Example Source: https://developer.sabre.com/soap-api/get-vehicle-policy/1.0.0/release-notes/update/1.0.0-April-30-2024.html This example illustrates the usage of LocationCode for retrieving a location-specific policy. LocationCode is mandatory when PolicyType is 'Location'. ```xml > ``` -------------------------------- ### Get Seats v3 Response Example Source: https://developer.sabre.com/rest-api/get-seats/3.0/examples/get-seats-v3/byreservationpayload_2pax_2seg.html This is an example response payload for the /byReservationPayload endpoint. It details available seats for the requested flight segments and passengers. ```json { "seats": [ { "segment": { "flight": { "carrierCode": "AA", "flightNumber": "123", "departure": { "airportCode": "LAX", "date": "2023-10-26" }, "arrival": { "airportCode": "JFK", "date": "2023-10-26" } } }, "availableSeats": [ { "seat": { "designator": "1A", "type": "WINDOW", "location": "FRONT", "amenities": ["POWER_OUTLET", "WIFI"] } }, { "seat": { "designator": "1B", "type": "AISLE", "location": "FRONT", "amenities": ["POWER_OUTLET"] } } ] }, { "segment": { "flight": { "carrierCode": "AA", "flightNumber": "456", "departure": { "airportCode": "JFK", "date": "2023-10-27" }, "arrival": { "airportCode": "LAX", "date": "2023-10-27" } } }, "availableSeats": [ { "seat": { "designator": "10C", "type": "WINDOW", "location": "MIDDLE", "amenities": [] } }, { "seat": { "designator": "10D", "type": "AISLE", "location": "MIDDLE", "amenities": [] } } ] } ] } ``` -------------------------------- ### SOAP Bed Types Example (Multiple Configurations) Source: https://developer.sabre.com/soap-api/get-hotel-avail-soap/5.0.0/help-documentation/product-normalization.html SOAP example for multiple bed type configurations, indicating support for only a single configuration at present. ```xml ``` -------------------------------- ### Run SAMPLESCRIPT Source: https://developer.sabre.com/sdk/sabre-red/help-documentation/com.sabre.edge.example.scribe_sampleplugin.html This script displays 'Hello World.' and automatically runs a hidden 'HelperScript'. It's triggered by active listening for commands starting with '1LAS'. ```SabreScript SAMPLESCRIPT ``` -------------------------------- ### Get Seats v3 /byReservationPayload Response Example Source: https://developer.sabre.com/rest-api/get-seats/3.0/examples/get-seats-v3/byreservationpayload_1pax_2seg.html This is an example response payload for the /byReservationPayload endpoint, illustrating the structure of seat availability for a given reservation. ```json { "seats": [ { "segmentId": "AA123-LAX-JFK-2023-10-26T10:00:00", "seat": { "seatCode": "1A", "type": "WINDOW", "location": "FRONT", "available": true, "price": { "amount": "25.00", "currency": "USD" } } }, { "segmentId": "AA123-LAX-JFK-2023-10-26T10:00:00", "seat": { "seatCode": "1B", "type": "AISLE", "location": "FRONT", "available": true, "price": { "amount": "20.00", "currency": "USD" } } }, { "segmentId": "DL456-JFK-MIA-2023-10-27T08:00:00", "seat": { "seatCode": "10C", "type": "MIDDLE", "location": "MIDDLE", "available": false, "price": null } } ] } ``` -------------------------------- ### Install Offline Bundle Source: https://developer.sabre.com/sdk/sabre-red/26.3/help-documentation/offline-bundle.html Execute this command in the `offline-bundle` directory to install the Offline Bundle. This installs typings in the user's home directory. ```bash ngv install ``` -------------------------------- ### Get Seats v3 /byReservationPayload Request Example Source: https://developer.sabre.com/rest-api/get-seats/3.0/examples/get-seats-v3/byreservationpayload_1pax_2seg.html This is an example request payload for the /byReservationPayload endpoint. It is used for scenarios with one passenger and two segments. ```json { "reservation": { "reservationItems": [ { "itemType": "SEGMENT", "segment": { "carrierCode": "AA", "flightNumber": "123", "departure": { "iataCode": "LAX", "pointType": "I" }, "arrival": { "iataCode": "JFK", "pointType": "I" }, "departureDateTime": "2023-10-26T10:00:00", "arrivalDateTime": "2023-10-26T18:00:00" } }, { "itemType": "SEGMENT", "segment": { "carrierCode": "DL", "flightNumber": "456", "departure": { "iataCode": "JFK", "pointType": "I" }, "arrival": { "iataCode": "MIA", "pointType": "I" }, "departureDateTime": "2023-10-27T08:00:00", "arrivalDateTime": "2023-10-27T11:00:00" } } ], "passengers": [ { "uuid": "f4a3b2c1-d0e9-4f8a-8b7c-6d5e4f3a2b1c", "firstName": "John", "lastName": "Doe" } ] } } ``` -------------------------------- ### Hotel Cancelation Example Source: https://developer.sabre.com/soap-api/create-itinerary/v1.19.22/help-documentation/making-hotel-booking.html Example of Host Display showing a cancelled Deployment ID and hotel booking details after a hotel reservation is cancelled post-COMMIT. ```text *P5 REMARKS 1.H-CONFERMA-GETTHERETEST 2..UU1-1234 3..UU2-DAVE BROWN 4.H-*/SVP*01 DEPLOYMENTID 10062605 CANCELLED ***** 5.H-*/SVP-01 HTL/2309/2609/1/66659921/2114 ```