Tour

Using this API

Use the Tour Rest API to Search, Check Policies and Book Tours with over 100 different suppliers all over the world.

The Tour Rest API has the following methods to use in this order:

  • Search: Used to define what types of tours you want, which Checkin date, number of days,number of passengers at the age of each passenger; Each Tour that will be returned has a list of activities where each activity will have its individual properties within that Tour.

  • GetPaymentPolicies: Used to check the Cancellation Policies for the chosen Tour.

  • DoBooking: Used to confirm a reservation, it sends the information of the passenger (s), payment information, the Tour and the chosen activity.

  • CancelBooking: Used to cancel a reservation.

  • GetServiceDetails: Serves to view the details of your reservation.

The API works with Json in its requests and responses, so text parameters can be identified by enclosing double quotation marks ("example"), boolean numbers and parameters can be sent normally.

Below you will find more information on the most important rules, possibilities, points of attention and properties to use for each method.

Tour API endpoint

Each method will have its own instance of the Cangooroo Booking Engine and, with that, each one will have its own endpoint. Unless otherwise specified, the endpoints of the Tour services will be:

  • {{URL}}/ws/Rest/Tour.svc/Search

  • {{URL}}/ws/Rest/Tour.svc/GetCancellationPolicies

  • {{URL}}/ws/Rest/Tour.svc/DoBooking

  • {{URL}}/ws/Rest/Tour.svc/Cancel

  • {{URL}}/ws/Rest/Tour.svc/GetServiceDetails

*Note the BOLD words in the example above, since they vary depending on the method you will be using.

Search

This is where everything begins. The Search Request is where you will pass your Credentials, the destination city ID, and a list of passengers (where each passenger will be separated by age) and a similar list for children, must also be informed the language, date of service and the number of days that will be spent on the Tour.

To see all properties contained in the Search Request and Response, please refer to this reference page.

Search Request

the Search Request is pretty simple, below you will find the most common usage of this method as well as some examples for the most Frequently Asked Questions we have.

{

"Credential": {

"Username": "Your_Username",

"Password": "Your_Password"

},

"Criteria":{

"CityId": 1009709,

"ChildAges": null,

"AdultAges": [25],

"ServiceLanguage": "all",

"ServiceDate": "2019-04-19",

"NumberOfDays": 2

}

}

Credential

The credentials tag is fairly simple and only has the UserName and the Password as shown below:

{

"Credential": {

"Username": "Your_Username",

"Password": "Your_Password"

},

The UserName space is where you're supposed to put in the UserName given you by the Operator. While the Password is where you're supposed to insert the Password given you by the Operator.

Criteria

The criteria field will be used for the specifications of your search, in it you will inform the Id of the city where the Tour will be made, the age of the children (this property can be excluded if there are no children on the tour), the age of the adults, languages of the Tour and the number of days you want to spend on the Tour.

Search Response

The survey response is separated between the response information, the token, the tours and their activities; Below you can see what each of these objects represents.

Token

The Token field is extremely important, as explained on our Services page. You will need this token to confirm the reservation of choosen tour and this information should be transported with each subsequent request.

A Token will always be unique and the combination of Token + Credentials + expiration ensures that we will never have matching results stored on our servers.

The TotalToursResults field provides information on the total number of results found, lastly the number of results in this single response.

When your search provides larger sets of results, those that affect the performance of your application and on those occasions, you will have to work with filters and paging our results.

Tours and Activities

In the survey response will be returned a list of Tours with their specifications, each Tour will also have a list of activities with different dates and times, so the user will have more freedom to choose both tours and activities.

*Some activities have separate prices between adults and children, while others have a total price based on search parameters.

GetCancellationPolicies

The GetPaymentPolicies is the method you should call after receiving the Search Response and after you've selected the tour and activity you wish to book. This is a mandatory step for our booking process, which means that you will must make this call before attempting to confirm your booking.

It is important to be aware that many Suppliers work with cached information to decrease response time when responding to availability requests. Therefore, some values may change from the Search Availability Response for Payment Policy Response, such as price, rate information, and other properties. That is why it is important to compare, verify and update your information and properly notify the user in case of changes.

To see all properties contained in the GetCancellationPolicies Request and Response, please refer to this reference page.

GetPaymentPolicies Request

The GetPaymentPolicies Request is straightforward and simple and below you will find an example along with the Frequently Asked Questions we have about it.

{

"Credential": {

"Username": "Your_Username",

"Password": "Your_Password"

},

"Token": "d09c4456-02cb-4a43-87e5-1e696ab6965f",

"TourId": 45219,

"IdAvailability": 1,

"ServiceDate": "19/04/2019"

}

Credential

The credentials tag is the same as required on the SearchAvailability Request with a UserName and a Password as shown below:

"Credential": {

"Username": "Your_Username",

"Password": "Your_Password"

},

The UserName field is where you're supposed to put in the UserName given you by the Operator. While the Password is where you're supposed to insert the Password given you by the Operator.

Token

As stated before, the Token you received on the SearchAvailability Response is extremely important because it is this information that binds the booking process together. To learn more about the Token, you can check our Services page.

TourId

id of the chosen tour, each tour has a list of different activities where the price and days may vary.

"TourId": 45219,

IdAvailability

id of the selected activity, after choosing the desired tour must be informed the id of the desired activity.

"IdAvailability": 1,

ServiceDate

is the date of the tour, the user will inform the date of the desired tour activity in dd/mm/yy format.

"ServiceDate": "19/04/2019"

GetCancellationPolices Response

In response, in addition to showing the tour information, the deadline for cancellation and the chosen activity, you can also see the supplier's questions, their quantity may vary from each supplier, in some cases, and there may even be no questions from the supplier for the user.

DoBooking

The DoBooking method is used to make the reservation of the Tour and the activity that was chosen in SearchAvaliability and dealt with in GetCancellationPolices, this is another simple but very important step, since here the main passenger and the escorts will be informed (if they have one) and also the provider's questions will be answered (if returned in GetCancellationPolices).

To see all properties contained in the DoBooking Request and Response, please refer to this reference page.

DoBooking Request

The DoBooking request is already a bit more complex, in addition to informing the IDs of the tour and the chosen activity, passengers will also be informed where one of them will be the main passenger, along with the supplier's questions that must be answered (if they have been returned in getCancellationPolicies method).

{

"Credential": {

"Username": "Your_Username",

"Password": "Your_Password"

},

"Token": "d09c4456-02cb-4a43-87e5-1e696ab6965f",

"TourId": 45246,

"IdAvailability": 1,

"Passengers": [{

"Name": "Test",

"Surname": "NoBook",

"Age": 25,

"Cpf": "123456789-10",

"Rg": "123456789",

"Title": "Mr",

"MainPax": true,

"isChild": false

}],

"SupplierQuestions": null

}

Credential

The credentials tag is the same as required on the SearchAvailability and GetCancellationPolicies Request with a UserName and a Password.

Token

The token that was generated in the survey and handled in the GetCancellationPolicies will be used for the last time to close the Tour reservation.

"Token": "d09c4456-02cb-4a43-87e5-1e696ab6965f",

TourId and IdAvaliabylity

here you will be informed the TourId and IdAvaliabylity to confirm the booking of the desired Tour.

"TourId": 45219,

"IdAvailability": 1,

Passengers

Here the user will inform the data of the passengers of the Tour between this data will be the RG, CPF and a Boolean variable to identify if the passenger is a child or not, remembering that it is obligatory 1 main passenger (usually the user who makes the reservation).

"Passengers": [{

"Name": "Test",

"Surname": "NoBook",

"Age": 25,

"Cpf": "123456789-10",

"Rg": "123456789",

"Title": "Mr",

"MainPax": true,

"isChild": false

}],

SupplierQuestions

Here the questions from the supplier will be answered, the number of questions may vary depending on each supplier and may even be null.

Each question has a CodeQuestion to identify them and a TypeQuestion that specifies the answer that the question can receive (this answer can be in text, boolean, numeric or numeric).

in our example below the question is null, but for representation, we will put a representation:

"SupplierQuestions": {

“CodeQuestion”: “123456”,

“TypeQuestionCode”: 4002,

“TypeQuestion”: “Texto”:

“Question”: “questão de teste”

“Answer”: “Resposta”,

“MinRange”: 0,

“MaxRange”: 0

}

Or

"SupplierQuestions": null

DoBooking Response

Here, the user can see the result of his request, together with the other information of his reservation, it is worth paying attention in the fields ServiceId (code of your reservation) and Status (status of your reservation) because they will be very important for the methods.

Cancel

This method is very simple, in which the user must inform, in addition to the credentials of the client, the ServiceId of his reservation made in the previous method.

To see all properties contained in the Cancel Request and Response, please refer to this reference page.

Cancel Request

The request is very simple, in it the user will only inform his credentials next to the id of the reservation made in the previous method.

{

"Credential": {

"Username": "Your_Username",

"Password": "Your_Password"

},

"ServiceId": 1466

}

Credential

The credentials tag is the same as required on the SearchAvailability, cancellationPolicies and DoBooking Request with a UserName and a Password as shown below:

"Credential": {

"Username": "Your_Username",

"Password": "Your_Password"

},

ServiceId

Is the id of the service generated in the reservation and shown in its response, through that id the user can cancel his reservation.

"ServiceId": 1466

After you enter the credentials of the user, the ServiceId of a reservation that was made with the credentials informed must be passed.

Cancel Response

In the cancellation response, the user will be able to see all the details of their canceled reservation.

GetServiceDetails

Here the user can view the details of all their reservations without the need to make changes to their reservation, either those that have been confirmed or canceled.

To see all properties contained in the Cancel Request and Response, please refer to this reference page.

GetServiceDetails Request

the use of this method is similar to that of the cancellation, after informing the credentials of the user, the ServiceId of the reservation must be informed.

{

"Credential": {

"Username": "Your_Username",

"Password": "Your_Password"

},

"ServiceId": 1465

}

GetServiceDetails Response

with the correct credentials and ServiceId, the webservice will return the details of your reservation.