Respax For Windows - XML API

Index


Overview

XML Api enables the tour operator provide XML RPC access to external companies. The Operator will need to have a web server and Respax Netwizard install to be able to provide access over this interface.


Using the API

The Respax XML API can be accessed directly from your preferred xmlrpc client environment. You will need to get the URL and port for the operator specific Netwizard installation from their system administrator and plug it into your xmlrpc client code.

Following are example links for connecting directly to a netwizard xmlrpc server. The appropriate link needs to be added to your xmlrpc clients connect function. Server address and port will need to be replaced with your operator's details. Each operator can have a training environment and a live environment. We strongly recommend that you develop against the training environment. You can control which environment you use by altering the config variable on the URL.

Example URLs for a training environment connection:

Connecting internally by a local network address:
https://192.168.0.1:443/netwizard/bin/dispatch.php?file=xmlrpc.respax-external&config=train

Connecting internally or externally by a domain name:
https://secure.example.com:443/netwizard/bin/dispatch.php?file=xmlrpc.respax-external&config=train

Example URLs for a live environment connection:

Connecting internally by a local network address:
https://192.168.0.1:443/netwizard/bin/dispatch.php?file=xmlrpc.respax-external&config=live

Connecting internally or externally by a domain name:
https://secure.example.com:443/netwizard/bin/dispatch.php?file=xmlrpc.respax-external&config=live

Once your connection is configured to the Netwizard xmlrpc server, you can start using the functions and parameters listed in the reference below. Please note that you will always have to call the login function first to initiate a session. The operator's system administrator will need to provide you with the login details.


Reference

Following is a list of functions available from the native respax api:


login

Returns a unique Session ID which needs to be reused in all functions after InitSession is called. InitSession authenticates your user id and validates the password for the duration of your connection. It also sets your default orgid and applies appropriate commissions rates.

Syntax:

login( <userid>, <password>)

The login function is called with two arguments and returns a string containing a session ID that must be appended to the server URL for all other function calls.

Argument

Description

userid

Identifier for a user that is configured as an agent. This is supplied by the operator.

password

Password for the agent user. This is also supplied by the operator.

Remarks:
This will create a unique session on the remote xmlrpc server. It returns a session id which must be appended to the xmlrpc server url for all subsequent function calls. If the session is idle for an extended period, it will automatically expire and you will have to call login again to start another session. All other functions will return an error if the session has expired.

Example PHP:

$strSessionID = login("harry", "ad12DSls");


readPaymentOptions

Returns an array or zero or more payment options. These are the payment options that are valid for the currently logged in user.

Syntax:

readPaymentOptions()

Remarks:
The payment option code is sent with a writeReservation call to indicate the method in which to collect payment.

Example PHP:

$arrPaymentOptions = readPaymentOptions();


readOperators

The readOperators function accepts two arguments. The first being an array of 0 or more complex search criteria and the second being an array of fields to be returned. The function returns an array of 0 or more associative arrays each containing the requested fields of one operator.

Syntax:

readOperators( < complex search criteria >, array ( "returnField1", "returnField2", ... ) )

Return Field

Description

strOrgID

The organisation ID

strOrgName

The organisation name

strOrgPhone

The organisation telephone number

strOrgFax

The organisation facsimile number

strOrgEmail

The organisation email address

strOrgStreetAddress1

The organisation street address information

strOrgStreetAddress2

strOrgStreetAddress3

strOrgStreetPostcode

strOrgStreetCountry

strOrgPostalAddress1

The organisation postal address information

strOrgPostalAddress2

strOrgPostalAddress3

strOrgPostalPostcode

strOrgPostalCountry

Example:

readOperators(array(), array("strOrgID", "strOrgName"));

This will return an array of associative arrays each containing the organisation ID and organisation name of a single operator.


readTours

The readTours function accepts two arguments. The first being an array of 0 or more complex search criteria and the second being an array of fields to be returned. The function returns an array of 0 or more associative arrays each containing the requested fields of one tour.

Syntax:

readTours( < complex search criteria >, array ( "returnField1", "returnField2", ... ) )

Return Field

Description

strTourCode

The tour code

strTourName

The tour name

Example:

readTours(array(), array("strTourCode", "strTourName"));

This will return an array of associative arrays each containing the tour code and tour name of a single tour.


readTourBases

Returns an array of basis combinations for a specific tourcode.

Syntax:

readTourBases( < simple search criteria >, array ( "returnField1", "returnField2", ... ) )

Search Field

Description

This function requires the following simple search criteria to successfully return a result

strTourCode

The tour code that you want to retrieve basis and sub basis combinations for

Return Field

Description

intBasisID

The ID number of the Basis

strBasisDesc

The name of the Basis

strBasisDesc2

The detailed description of the Basis

intSubBasisID

The ID number of the Sub Basis

strSubBasisDesc

The name of the Sub Basis

Example:

readTourBases( array("strTourCode" => "BRUCE"), array("intBasisID", "strBasisDesc", "intSubBasisID", "strSubBasisDesc")));

This will return an array of associative arrays each containing a single BRUCE basis / sub basis combination.


readTourTimes

Returns the departure times for a specific tour.

Syntax:

readTourTimes( < simple search criteria >, array ( "returnField1", "returnField2", ... ) )

Search Field

Description

This function requires the following simple search criteria to successfully return a result

strTourCode

The tour code that you want to retrieve departure times for

Return Field

Description

intTourTimeID

The ID number of the departure time

dteTourTime

The departure time

Example:

readTourTimes( array("strTourCode" => "COBBER"), array("intTourTimeID", "dteTourTime")));

This will return an array of associative arrays each containing a single COBBER departure time.


readTourPickups

Returns the pickup locations and times for a specific tour and departure time.

Syntax:

readTourPickups( < simple search criteria >, array ( "returnField1", "returnField2", ... ) )

Search Field

Description

This function requires the following simple search criteria to successfully return a result

strTourCode_Link

The tour code that you want to retrieve pickup information for

intTourTimeID_Link

The tour time that you want to retrieve pickup information for

intBasisID

Some tours have pickups specific to the basis. Provide the basis id to ensure you get a complete and accurate list of pickups

ysnDefShow

This criteria is optional and allows you to restrict the pickups to the default (-1) or non default (0) routes.

Return Field

Description

intPickupID

The ID number of the pickup.

strPickupName

The name of the pickup location. (deprecated - use strPickupValue)

strPickupDesc

The description of the pickup location. (deprecated - use strPickupValue)

PickupTime

The time of the pickup. (deprecated - use strPickupValue)

strTourCode

The tour code of the route that the pickup is on.

intTourTimeID

The tour time id of the route the pickup is on.

strPickupKey

A concatenation of route code, route time and pickup id that uniquely identifies a pickup.

strPickupValue

The location and time of the pickup. Replaces individual pickup location and time fields.

Example:

readTourTimes( array("strTourCode" => "COBBER"), array("intTourTimeID", "dteTourTime")));

This will return an array of associative arrays each containing a single COBBER pickup.


readTourWebDetails

The readTourWebDetails function accepts two arguments. The first being an array of 0 or more complex search criteria and the second being an array of fields to be returned. The function returns an array of 0 or more associative arrays each containing the requested fields of one tour.

Syntax:

readTourWebDetails( < complex search criteria >, array ( "returnField1", "returnField2", ... ) )

Return Field

Description

strTourCode

The tour code

strTitle

A short concise title describing the tour

strCatchPhrase

A general description or blurb promoting key features of the tour

strIncludes

A list of specifics that are included with the tour

strAdditional

Any additional information the passenger needs to know about the tour

strLevyDesc

Details of any levies that apply to the tour

strComment

A message that should be displayed when booking indicating the information needed in the comment field

strAvailability

A message that should be displayed when booking indicating valid travel dates for the tour

strDuration

The estimated tour duration. This can be variable based on the options selected when booking

dteLastUpdated

The last time the web details were updated. This can be used to determine if the web details have changed without retrieving all the information

b64SmallImage

A base64 encoded image. Operators have been advised to make this image 160x160 in size

b64LargeImage

A base64 encoded image. Operators have been advised to make this image 180x240 in size

b64IncludeImage

A base64 encoded image. Operators have been advised to make this image 80x80 in size

Example:

readTourWebDetails(
    array ("strField" => "strTourCode", "strOperator" => "-*", "strValue1" => "G"),
    array("strTourCode", "strTitle", "b64IncludeImage")
);

This will return an array of associative arrays, containing the tour code, title and a base 64 encoded image of any tour where the tour code starts with G.

External Links:


readReservations

The readReservations function accepts two arguments. The first being an array of 0 or more complex search criteria and the second being an array of fields to be returned. The function returns an array of 0 or more associative arrays each containing the requested fields of one reservation.

Syntax:

readReservations( < complex search criteria >, array ( "returnField1", "returnField2", ... ) )

Return Field

Description

intCfmNo

The confirmation number of the reservation

strTourCode

Details of the tour that has been booked

intBasisID

intSubBasisID

dteTourDate

The date the pax is due to travel

intTourTimeID

The ID of the departure time

strPaxName

The name of the pax the reservation was taken for

ysnIsConfirmed

Is the reservation confirmed?

ysnIsCancelled

Is the reservation cancelled?

strCancelReason

The reason for the cancellation

dteEntered

The date the reservation was taken

dteUpdated

The date the reservation was last modified

Example:

readReservations(array(array("strField" => "strTourCode", "strOperator" => "=", "strValue1" => "ATR"), array("intCfmNo", "strPaxName"));

This will return an array of associative arrays each containing the confirmation number and pax name of an ATR reservation.


readCreditCardTypes

Returns an array of associative arrays each containing details of a credit card type that the operator is capable of processing when commiting a reservation.

Syntax:

readCreditCardTypes()

Return Field

Description

strCCTypeID

The card type identifier. This must be passed as strCardTypeID in the card details when booking with credit card payment.

strCCDesc

The full name of the card type.

dblWebCardFee

The percentage fee that will be applied to the total transaction amount when the operator processes the credit card.


writeReservation

Creates a new reservation or updates and existing reservation. To write a new reservation, the simple search criteria must pass -1 as the confirmation number. All values must be provided when making a new reservation. Only the desired changes need to be provided when updating a reservation. Changing basis, sub basis, tour date or tour time will result in an availability check.

This function will return an associative array similar to the following.

array ("writeReservation_AddNew" => TRUE, "intCfmNo" => 45838) when writing new reservations.
array ("writeReservation_Update" => TRUE) when altering existing reservations.

Syntax:

writeReservation( array confirmation, array reservation, array payment, array creditcard )

Confirmation Field

Description

This function requires the following simple search criteria to successfully return a result

intCfmNo

The confirmation number of the reservation to be written to. Pass a confirmation number of -1 to write a new reservation

Reservation Field

Description

strTourCode

The tour code that is being booked. This can only be set when writing a new reservation

intBasisID

The basis that is being booked

intRoomTypeID

The room type or subbasis that is being booked

dteTourDate

The date of travel

intTourTimeID

The ID of the departure time

intNoPax_Adults

The number of pax type 1 (default adult) in the booking.

intNoPax_Infant

The number of pax type 2 (default infant) in the booking.

intNoPax_Child

The number of pax type 3 (default child) in the booking.

intNoPax_FOC

The number of pax type 4 (default foc) in the booking.

intNoPax_UDef1

The number of pax type 5 (default udef) in the booking.

strPaxFirstName

The first name of the passenger

strPaxLastName

The last name of the passenger

strPaxEmail

The email address of the passenger

strPaxMobile

The mobile number of the passenger

ysnIsConfirmed

The confirmed status of the booking. -1 for confirmed, 0 for unconfirmed or quote

strPickupRouteCode

The route code for the selected pickup.

intPickupRouteTimeID

The route time id for the selected pickup.

intPickupID

The pickup location id for the selected pickup.

strGeneralComment

The free type comment from the agent and/or passenger.

Payment Field

Description

strPaymentOption

The preferred payment option for the reservation. This should be set to one of the following payment options. The credit status of your agent organisation may prevent use of some of the payment options.

Payment Option

Description

agent

The agent collects the full amount.

agent/levy

The agent collects the full amount less the levy. The levy is collected POB by the operator.

agent/comm

The agent collects his commission as a deposit. The remainder is collected POB by the operator.

credit

The full amount is collected by credit card.

ccard/levy

The full amount less the levy is collected by credit card. The levy is collected POB by the operator.

pob

The full amount is collected POB by the operator.

Credit card fields are only required if the payment option is credit or ccard/levy. For other payment options an empty array or null value may be passed instead.

Credit Card Field

Description

strCardName

The name as it appears on the credit card.

strCardPAN

The credit card number.

strCardVN

The credit card verification number.

strCardTypeID

String identifier for the type of credit card.(eg. visa, mc, ae)

intCardExpiryMonth

Integer representation of the expiry month. (1-12)

intCardExpiryYear

Four digit integer representation of the expiry year. (eg. 2008, 2012)

Example:

writeReservation(
    array("intCfmNo" => -1),
    array(
        "strTourCode" => "ATR",
        "intBasisID" => 417,
        "intRoomTypeID" => 1665,
        "dteTourDate" => "30-DEC-2004",
        "intTourTimeID" => 31,
        "strPaxFirstName" => "Wernher",
        "strPaxLastName" => "von Braun",
        "strPaxEmail" => "wernher@example.com",
        "strPaxMobile" => "12345678"),
    array("strPaymentOption" => "pob")
);

This will create a new ATR reservation for Wernher von Braun on the 30th of December with the full price of the tour being collected POB by the operator.

writeReservation (array("intCfmNo" => 33687), array("strPaxMobile" => "12345678"));

This will update the pax mobile number in reservation 33687.


writeCancellation

This function will cancel a reservation with a specific confirmation number, writing the cancellation reason into the reservation. It returns an associative array of ("writeCancellation" => TRUE) on success.

Syntax:

writeCancellation( array ("intCfmNo" => confirmation number),
    array ( "strCancelReason" => "cancellation reason" ) )

Example:

writeCancellation( array("intCfmNo" => "32499"), array("strCancelReason" => "Pax broke an arm."));

This example will cancel booking 32499 and set "Pax broke an arm." as the reason for cancelling.


readTourAvailability

A tour trip is a single instance of tour, basis, sub basis, date and time. This function returns the number of available seats for a specific tour trip.

Syntax:

readTourAvailability( < simple search criteria > )

Search Field

Description

This function requires the following simple search criteria to successfully return a result

strTourCode

The details of tour trip that you want to retrieve availability for

intBasisID

intSubBasisID

dteTourDate

intTourTimeID

Example:

readTourAvailability( array("strTourCode" => "ATR", "intBasisID" => 43, "intSubBasisID" => 1665, "dteTourDate" => "17-01-2005", "intTourTimeID" => 55));

This will return the number of seats on ATR (with specified basis) departing on 17th January, 2004 at the specified tour time.


readTourPrices

A tour trip is a single instance of tour, basis, sub basis, date and time. This function returns an array containing the adult, child and infant prices for a specific tour trip.

Syntax:

readTourPrices( < simple search criteria > )

Search Field

Description

This function requires the following simple search criteria to successfully return a result

strTourCode

The details of tour trip that you want to retrieve prices for

intBasisID

intSubBasisID

dteTourDate

intTourTimeID

Example:

readTourPrices( array("strTourCode" => "ATR", "intBasisID" => 43, "intSubBasisID" => 1665, "dteTourDate" => "17-01-2005", "intTourTimeID" => 55));

This will return the adult, child and infant price for an ATR (with specified basis) departing on 17th January, 2004 at the specified tour time.


Simple Search Criteria

Simple search criteria are constructed as an associative array where the keys are the field names and the values are the criteria. Simple search criteria are always evaluated as field = value and are commonly used in functions where a specific search criteria is required to get a result.

Examples:

array ( "strTourCode" => "BIGTRIP" )

This will find all records where the tour code is "BIGTRIP".

array ( "strTourCode" => "SMALLTRIP", "dteTourDate" => "31-DEC-2004" )

This will find all records where the tour code is "SMALLTRIP" AND the tour date is 31st of December, 2004.


Complex Search Criteria

Unlike simple search criteria which assume that field = value, complex search criteria allow the use of other operators. Functions that can return large record sets generally use complex search criteria to allow extensive narrowing of search results.

Operator

Description

=

Field is equal to value1

>

Field is greater than value1

<

Field is less than value1

>=

Field is greater than or equal to value1

<=

Field is less than or equal to value1

><

Field is between value1 and value2

*-

Field performs a wildcard match at the start of value1

-*

Field performs a wildcard match at the end of value1

**

Field performs a wildcard match at the start and end of value1

Examples:

array ( array ( "strField" => "strPaxName", "strOperator" => "-*", "strValue1" => "John") )

This will find all records where the pax name starts with "John".

array ( array ( "strField" => "dteTourDate", "strOperator" => "><", "strValue1" => "01-DEC-2004", "strValue2" => "31-DEC-2004" ), array ( "strField" => "intPaxNo_Adults", "strOperator" => ">=", "strValue1" => 2 ) )

This will find all records where the tour date is betwen the 1st and 31st of December, 2004 and the number of adults travelling is 2 or more.


r4w api (last edited 2011-04-01 00:47:07 by phil)