Breadcrumb
SrwSyncApi
Sabre Red 360 Software Development Kit provides a capability to execute several sabre services from a Red App web module.
Acquiring SrwSyncApi
In order to obtain SrwApi and use you need to import it, e.g.
import {SrwSyncApi} from "sabre-ngv-app/app/services/impl/SrwSyncApi";
Then inside your source obtain the service as follows:
const srwApi = getService(SrwSyncApi);
Available methods
There are several methods available in SrwApi, below you can find detailed list of them.
sws |
---|
Type Parameteres:
Returns: |
swsWithLock |
---|
Type Parameteres:
Returns: |
lock |
---|
Returns: |
lockWithTimeout |
---|
Type Parameteres:
Returns: |
tryLock |
---|
Type Parameteres:
Returns: |
unlock |
---|
Type Parameteres:
Returns: |
showInEmu |
---|
Type Parameteres:
Returns: |
executeInEmu |
---|
Type Parameteres:
Returns: |
rest2Sg |
---|
Type Parameters:
Returns |
rest2SgWithLock |
---|
Type Parameters:
Returns |
rest2SgWithHeaders |
---|
Type Parameters:
Returns |
rest2SgWithHeadersAndLock |
---|
Type Parameters:
Returns |
Authorization
In order to be able to use specific services through SrwApi, your Red App needs to have authorization for those services in it’s redapp.xml file.
SWS:
<Authorization name="com.sabre.edge.cf.sws.SWS" threshold="[threshold]" metric="[metric]"/>
Locking/Unlocking:
<Authorization name="com.sabre.edge.cf.host.Locking" threshold="[threshold]" metric="[metric]" />
ShowInEmu:
<Authorization name="com.sabre.edge.cf.emu.ShowInEmulator" threshold="[threshold]" metric="[metric]" />
ExecuteInEmu:
<Authorization name="com.sabre.edge.cf.emu.ExecuteInEmulator" threshold="[threshold]" metric="[metric]" />
Rest2SG:
To be able to connect to a Rest endpoint, e.g.
/v4/lists/utilities/geocode/locations
and
/v1/lists/utilities/aircraft/equipment
You need to add authorization to redapp.xml:
<CFBundle>
<RedApp id="rest-comm-sabre-sample">
<Authorization name="com.sabre.edge.cf.rest2sg.Rest2Sg">
<Action name="/v4/lists/utilities/geocode/locations"
threshold="1" />
</Authorization>
<Authorization name="com.sabre.edge.cf.rest2sg.Rest2Sg">
<Action name="/v1/lists/utilities/aircraft/equipment"
threshold="1" />
</Authorization>
</RedApp>
</CFBundle>
otherwise there will be an AUTH error response from 2SG.