====== Trips method ======
Get a list of trips (periods)
===== Valid content types =====
* ''pauschal''
* ''hotel''
* ''trips''
* ''charter''
* ''oneway''
* (''extras'' **is not supported!**)
===== Description =====
public array trips( array $searchData, array $headerData, $topOffersFilter = array(), boolean $cleanUrl = true)
===== Parameters =====
* ''searchData (array)'' : search parameters. Required serach parameters: ''vnd'', ''bsd'', ''epc'', ''tdc'', ''gid''
* ''headerData (array)'' : [[soap_header|SOAP Header Information]]
* ''cleanUrl (bool)'' : TRUE returns clean friendly URLs.
* ''topOffersFilter (array)'' : top offers filter. Results that match this filter will be listed at the beginning of trips list
Example ''$topOffersFilter'':
array(
'toc' => 'PALM', // touroperator PALM
)
===== Return Values =====
Returns a list of available trips. Here is an example of output:
Array
(
[header] => Array
(
[typ] => hotel
[offers] => 106
[rgc] => 659
[rgn] => Dalmatia
[rgg] => 100023
[rggn] => Croatia
[pages] => 6
[perpage] => 20
[offset] =>
[sid] => b8hf8e9qene0lf8v46lujkokl2
)
[offer] => Array
(
[pic] => http://www.ors.si/giata-pics/2224352079381//full.jpg
[gid] => 2224352079381
[htn] => Bretanide Wellness & Sport Resort
[stc] => 4.0
[ovr] => 0
[oid] => 18703
[hon] => Bol / Brac
[fcts] => bea=0,ben=0,chf=0,clb=0,ani=0,pol=0,wel=0,spt=0,sgl=0,stn=0,ski=0
[dtemp] =>
[wtemp] =>
[rgc] => 659
[rgn] => Dalmatia
[rgg] => 100023
[rggn] => Croatia
[geo] => 0
)
[trips] => Array
(
[0] => Array
(
[sub] => catalog
[gid] => 2224352079381
[toc] => PALM
[ton] => Palma
[rgc] => 659
[oid] => 18703
[zac] => DZ
[zan] => double room
[vpc] => AI
[vpn] => all inclusive
[htc] => LEHRV3041439
[svc] => 26700 DZ AI
[vnd] => 2014-09-27
[bsd] => 2014-09-30
[tdc] => 3
[md5p] => 9fe8b14bfd2d90a5bc841951834625aa
[md5t] => 000f98a576b35158c09a10aaadec4fa0
[hsc] => 000f98a576b35158c09a10aaadec4fa0
[ppc] => 192
[cppc] => 202
[alt] => 0
[top] => 0
[aid] =>
[atx] =>
[iid] =>
[itx] =>
[lid] =>
[ltx] =>
[vid] =>
[vtx] =>
[zid] => palm_26700
[ztx] => 1/2 BM AC; ALL
[tocpic] => http://www.ors.si/ibe/ikonce/toc/palm.gif
[doplacila_opis] => DO 16 LET NA DODATNEM LEĹ˝IĹ ÄU;AKCIJA -5%
[url] => ?epc=2&vnd=1&bsd=300&toc=&tdc=1-7&rgc=659&gid=2224352079381&sel[hsc]=000f98a576b35158c09a10aaadec4fa0&sel[toc]=PALM&sel[sid]=&sel[gid]=2224352079381
)
...
[filters] => Array
(
[toc] => Array
(
[selected] => 0
[val] => Array
(
[PALM] => Palma
)
)
[vnd] => Array
(
[selected] => 0
[val] => Array
(
[20140903] => 2014-09-03
[20140906] => 2014-09-06
[20140910] => 2014-09-10
[20140927] => 2014-09-27
[20140928] => 2014-09-28
[20140929] => 2014-09-29
[20140930] => 2014-09-30
[20141001] => 2014-10-01
[20141002] => 2014-10-02
[20141003] => 2014-10-03
[20141004] => 2014-10-04
[20141005] => 2014-10-05
[20141006] => 2014-10-06
[20141007] => 2014-10-07
[20141008] => 2014-10-08
)
)
[tdc] => Array
(
[selected] => 0
[val] => Array
(
[3] => 3
[4] => 4
[5] => 5
[6] => 6
[7] => 7
)
)
[zac] => Array
(
[selected] => 0
[val] => Array
(
[DZ] => double room
[FZ] => family room
)
)
[vpc] => Array
(
[selected] => 0
[val] => Array
(
[AI] => all inclusive
)
)
[alt] => Array
(
[selected] => 0
[val] => Array
(
[0] => 0
)
)
)
[rfilters] => Array
(
[ppc] => "192-1015"
)
[sorts] => Array
(
[toc] => 0
[vnd] => 0
[tdc] => 0
[zac] => 0
[vpc] => 0
[ppc] => asc
)
...
===== Return parameters =====
* ''header'' (array) : information about a selected region and paging information
* ''typ'' : content type
* ''offers'' : number of offers found
* ''pages'' : number of pages
* ''perpage'' : records per page
* ''offset'' : current page (first page have offset 0, second page have offset 1, ...)
* ''sid'' : session id used
* ''rgc'' : selected region code (ID)
* ''rgn'' : selected region name
* ''rgg'' : selected region group code (ID)
* ''rggn'' : selected region group name
* ''offer (array)'' : an offer information
* ''pic'' : full picture
* ''gid'' : GIATA ID
* ''htn'' : accommodation name
* ''stc'' : hotel category
* ''ovr'' : overall rating
* ''hon'' : city name
* ''oid'' : city ID
* ''fcts'' : all available facts
* ''dtemp'' : air temparature
* ''wtemp'' : water temperature
* ''rgc'' : region code (ID)
* ''rgn'' : region name
* ''rgg'' : region group ID
* ''rggn'' : region group name
* ''geo'' : does this property has a geo location coordinates (1) or not (0)
* ''lat'' : latitude
* ''lon'' : longitude
* ''trips (array)'' : a list of trips
* ''sub'' : sub category (catalog, earlybird, lastmin, ski-pack). For content type ''trips'' you have this special sub values:
* **trip** : regular bus trip
* **busplane** : combined trip with bus & plane
* **busplaneship** : combined trip with bus, plane and ship
* **cruise** : cruise | trip with ship
* **plane** : trip with plane
* **train** : transport with train
* ''gid'' : accommodation GIATA ID
* ''toc'' : touroperator code
* ''ton'' : touroperator name
* ''tocpic'' : touroperator logo
* ''zac'' : room type code
* ''zan'' : room type name
* ''vpc'' : service type code
* ''vpn'' : service type name
* ''htc'' : hotel code (or product code)
* ''svc'' : service code
* ''vnd'' : checkin date
* ''bsd'' : checkout date
* ''tdc'' : duration
* ''md5p'' : unique hash for this offer (for internal use only)
* ''md5t'' : unique hash for this trip (for internal use only)
* ''hsc'' : unique hash for this trip
* ''alt'' : alternative trip (1) or a normal trip (0)
* ''top'' : top trip (1) or a normal trip (0)
* ''aid'' , ''iid'' , ''lid'' , ''vid'' , ''zid'' : (for internal use only)
* ''atx'' : room facilities text
* ''ltx'' : room location text
* ''ztx'' : room detail description
* ''itx'' : included services in room price
* ''ppc'' : price per person
* ''cppc'' : catalog price (if cppc is grater then zero, then this is information about catalog price -- without discounts)
* ''ahc'' : departure airport (IATA code)
* ''zhc'' : arrival airport (IATA code)
* ''sid'' : entry point ID (only for ''trips'' content type)
* ''sin'' : entry point name (only for ''trips'' content type)
* ''status'' : trip status (only for ''trips'' content type)
* **1** : trip is guaranteed
* **0** : trip is cancelled
* **3** : trip is almost guaranteed
* **4** : trip is finished
* else : trip has no status
* ''url'' : a suggested URL with search parameters for [[check|check method]]
* ''filters (array)'' : all possible filters
* ''toc (array)'' : filters by touroperators
* ''selected'' : (0) if this filter is not selected, (1) if this filter is selected
* ''val (array)'' : a list of values you can use for this filter
* ''vnd'' : filters by checkin date
* ''tdc'' : filters by duration period
* ''zac'' : filters by room types
* ''vpc'' : filters by service types
* ''ahc'' : filters by departure airport (only for ''pauschall'', ''charter'', and ''oneway'' content types
* ''alt'' : filters alternative trips
* ''rfilters (array)'' : range filters
* ''ppc'' : filters by price per person
* ''sorts (array)'' : possible sorting
* ''toc'' : sort by touroperator name
* ''vnd'' : sort by checkin date
* ''tdc'' : sort by duration
* ''zac'' : sort by room type
* ''vpc'' : sort by service type
* ''ppc'' : sort by price (default sorting)
===== Examples =====
* Example with basic search parameters with selected hotel (GIATA ID)
$searchParams = array(
'vnd' => '30.10.2014', // start date
'bsd' => '15.11.2014', // end date
'tdc' => '1-4', // duration [min-max] days
'epc' => '2', // number of adults
'gid' => '71088', // selected hotel by GIATA ID
);
$trips = $soapClient->orsxml_hotel_api_call( 'trips', $searchParams, $header );
* Example using filters
// filter offers using single filter
$searchParams = array(
'vnd' => '30.10.2014', // start date
'bsd' => '15.11.2014', // end date
'tdc' => '1-4', // duration [min-max] days
'epc' => '2', // number of adults
'gid' => '71088', // selected hotel by GIATA ID
'filter' => array(
'tdc' => '2' // filter by duration (display only trips with duration 2 nigths)
)
);
$trips = $soapClient->orsxml_hotel_api_call( 'trips', $searchParams, $header );
// filter offers using more then one filters
$searchParams = array(
'vnd' => '30.10.2014', // start date
'bsd' => '15.11.2014', // end date
'tdc' => '1-4', // duration [min-max] days
'epc' => '2', // number of adults
'gid' => '71088', // selected hotel by GIATA ID
'filter' => array(
'tdc' => '2', // filter by duration (display only trips with duration 2 nigths)
'vnd' => '20140903' // filter by checkin date (display only trips that starts on 3rd Sep. 2014)
),
'rfilter' => array(
'ppc' => '50-100' // filter by price range
)
);
$trips = $soapClient->orsxml_hotel_api_call( 'trips', $searchParams, $header );
* Example using sorting
// filter offers using single filter
$searchParams = array(
'vnd' => '30.10.2014', // start date
'bsd' => '15.11.2014', // end date
'tdc' => '1-4', // duration [min-max] days
'epc' => '2', // number of adults
'gid' => '71088', // selected hotel by GIATA ID
'sort' => 'vnd|asc' // sort by checkin date in ascending order
);
$trips = $soapClient->orsxml_hotel_api_call( 'trips', $searchParams, $header );
// filter offers using more then one filters
$searchParams = array(
'vnd' => '30.10.2014', // start date
'bsd' => '15.11.2014', // end date
'tdc' => '1-4', // duration [min-max] days
'epc' => '2', // number of adults
'gid' => '71088', // selected hotel by GIATA ID
'sort' => 'ppc|desc' // sort by price in descending order
);
$trips = $soapClient->orsxml_hotel_api_call( 'trips', $searchParams, $header );
* Example using paging
// filter offers using single filter
$searchParams = array(
'vnd' => '30.10.2014', // start date
'bsd' => '15.11.2014', // end date
'tdc' => '1-4', // duration [min-max] days
'epc' => '2', // number of adults
'gid' => '71088', // selected hotel by GIATA ID
'toffset' => '3' // display 4th page (toffset 0 returns 1st page)
);
$trips = $soapClient->orsxml_hotel_api_call( 'trips', $searchParams, $header );
===== JSON Examples =====
@see [[ors-soap-api:public:json_api]] how to post request.
{
"requestType" : "search",
"action": "trips",
"search": {
"typ": "hotel",
"vnd": "2018-01-10",
"bsd": "2018-03-10",
"tdc": "1-5",
"gid": "15257",
"epc": "2"
},
"top" : {
"toc" : "FTI"
},
"header": {
"lang": "[lang]",
"usr" : "[usr]",
"pass": "[pass]",
"agid": "[agid]"
}
}