BookingBuilder Genie Web Services

 

Through the BookingBuilder Genie web services, data in BookingBuilder Genie lookup tables can be manipulated, prompts can be enabled/disabled, and statistical data on prompt actions can be retrieved.

Web services provide a way for programmers to interact with outside systems via the internet. The BookingBuilder Genie Web Services are written using .Net and can be easily accessed by an experienced programmer.

 

The general BookingBuilder Genie web services are at: https://webservices.bookingbuilder.com/BBAdmin/WebService/BBGenie.asmx

 

General Information

All of the web services functions require an email address and password. These must be authorized for the group that holds the prompts, lookup tables or data you are manipulating. Group-specific logins will work, but only for their single group. Company-wide logins will work for all groups in a company account.

Most of the web services return at least a boolean success indicator, and an error message string.

 

Enable/Disable Prompts

This provides a very effective way for your systems to control the prompts viewed by your travel counselors. For example, let's say that you have a primary preferred airline, BB, and a secondary preferred airline, CC. You have an internal system that tracks bookings from your back office. At the beginning of each month, BB is the airline you want Genie to promote. However, once you reach your quota on BB, you want to switch the promotion to CC. This is now very easily achieved through the BookingBuilder Genie Web Services.

First, create two prompts: One that promotes BB and one that promotes CC. In the list of prompts is the Prompt ID; note this for these two prompts. Now you simply write a small program that uses the web services to enable the BB prompt and disable the CC prompt at the beginning of the month. Your program can then check the quota daily; once the quota for BB has been reached, disable that prompt and enable the CC prompt. The enable prompt and disable prompt web services are documented at:

https://webservices.bookingbuilder.com/BBAdmin/webservice/BBGenie.asmx?op=oEnablePrompt
https://webservices.bookingbuilder.com/BBAdmin/webservice/BBGenie.asmx?op=oDisablePrompt

ixBBMsgMaster is the prompt ID. Note that after you enable and/or disable prompts, you must prepare the prompts for download. If you don't do this, the workstations will not get the updated prompt status. The web service for this is:

https://webservices.bookingbuilder.com/BBAdmin/webservice/BBGenie.asmx?op=oPreparePromptsOnlyForDownload

Note that the above web service prepares all prompts in the specified group for download. If other prompts in the group are in progress, this could cause problems. We suggest that you create a separate group for remotely enabled/disabled prompts, and share that group to the groups with your computers. This helps ensure that no prompts accidentally make to the workstations.

 

Lookup Tables

There are several web services that allow you to manipulate data in BookingBuilder Genie lookup tables. Just like with prompts, once you are finished changing data in a lookup table, you must prepare the lookup table for download. To prepare only the lookup tables in a specific group for download, use:

https://webservices.bookingbuilder.com/BBAdmin/webservice/BBGenie.asmx?op=oPrepareLookupTablesOnlyForDownload

 

Important: Since these functions modify data directly in the BookingBuilder Genie lookup tables, we strongly suggest that you create a test group and a test lookup table and use those for development purposes until you are comfortable with the web services functions. This will help ensure that only correct data is sent to your workstations.

The first function appends data to an existing lookup table. In addition to the email address and password, the group ID and lookup table name are specified. An array of LookupTableData objects specifies the data to be added.

Important: When creating the LookupTableData objects, be sure to fill in all fields except ixLTData (ixLTData is set by our server when retrieving data.) Any string field you are not using should be set to an empty string; unused date fields should be set to 1900-01-01 ("1900-01-01T00:00:00" if you are manually constructing the XML). It is important that you use these default values.

Please note that BookingBuilder Genie Build 270 and newer support 10 fields each of string, date and numeric, for a total of 30 fields. Previous builds only support 5 fields of each. The server supports all 30 fields regardless of which build you have installed.

 

Replace All Data

If you want to delete all existing data in a lookup table and replace it with new data, use this function.

 

Delete/Query/Update Data

When you delete, query and update data in lookup tables, you must create conditions. These conditions are parsed into a SQL Where clause. In keeping with our focus on data security, we do not allow you to specify a where clause, as that can be subject to SQL injection attacks. Instead, you create QueryCondition objects that contain the parts of the Where clause. Our server code then validates these and constructs a proper Where clause. For example, if this is the Where clause:

WHERE ((sData1 = 'hello' OR sData1 = 'bye') AND dblData3 >= 999) OR dtData1 = '2009-02-15'

The first QueryCondition object would be:

iOpenParenCount = 2
sFieldName = "sData1"
sOperator = "="
sValue = "hello"
iCloseParenCount = 0
sCombiner = "OR"

This means to start with two open parens, as in "((", then "sData1 = 'hello", no close parens, then OR. The next QueryCondition object would be:

iOpenParenCount = 0
sFieldName = "sData2"
sOperator = "="
sValue = "bye"
iCloseParenCount = 1
sCombiner = "AND"

This means to add "sData2 = 'bye'" then a close paren, then "AND". Continue adding these until all the conditions are specified.

You create one QueryCondition object for each field/value in the query. You do not need single quotes around string or date values; these are added by our code. Supported operators are =, <>, <, >, <=, >=. Supported combiners are AND and OR. Supported field names are ixLTData, sData[1-10], dtData[1-10], and dblData[1-10]. If any unsupported data is found in these objects, the entire transaction is aborted. Building the conditions this way gives you total flexibility while protecting the data.

The Update Data function updates all rows that meet the specified conditions, just like a standard SQL Update.

 

Query Data

You can query a count of matching records, just like a SQL "SELECT COUNT(*)", or query the data. When you query the data, an array of LookupTableData objects is returned. These contain the data from each row, including the value for ixLTData, which an identity column. It is unique for each row, and can be used in the delete and update conditions.

 

Querying Statistical Data

Each time a prompt action fires, such as Display Notification Window, or Track For Reporting, data is entered into the Prompt Action table. The BookingBuilder Genie reports use this data. You can query the raw data, getting either a count of matching records, or the actual data. For example, if you have a prompt for a preferred airline, add a Track For Reporting action that puts unique information into the database for that prompt. Then you can have a program query our database daily to see how many times that prompt appeared. You could also get the raw data, and create your own report to show how many times it appeared on each computer each day of the week.

The available fields are:

 

ixALPrompAction The identity column that uniquely identifies each row.
dtTimeStamp The date and time the action fired, in local time on your workstation.
iComputerID The numeric computer identifier from the BookingBuilder About screen.
sComputerName The name of the computer.
sComputerNickname The nickname of the computer as configured in the BB Admin Site.
iGroupID The Group ID of the computer at the time the action was fired.
sGroupName The current name of the group identified by iGroupID.
ixBBMsgMaster The Prompt ID of the prompt to which the action belongs.
sPromptName The name of the prompt.
sNWName The name of the notification window if the action came from a notification window within a prompt.
sData1, sData2, sData3 Additional data on each action, or user-specified in Track For Reporting.
bIsFromNW True if the actions came from a Notification Window within a prompt (such as clicking a window and having a set of actions fire)
ixBBMsgActionType The numeric action identifier.
sActionName The name of the action performed.

     

                                                 All of these fields may be specified in the conditions, and they are returned in the data query.

 

Summary 

https://webservices.bookingbuilder.com/BBAdmin/webservice/BBGenie.asmx
oAppendToLookupTable Appends data to the specified lookup table.
oDeleteDataFromLookupTable Deletes data from the specified lookup.
oDisablePrompt Disables a prompt. The prompt is not deleted, and my be enabled at any time.
oEnablePrompt Enables a prompt.
oPrepareLookupTablesOnlyForDownload Prepares the lookup tables in a specified group for download. This must be done after any lookup table changes so that the workstations get the updated data.
oPreparePromptsOnlyForDownload Prepares the prompts in a specified group for download. This must be done after enabling/disabling prompts so that the workstations get the updated prompt settings.
oQueryCountFromLookupTable Queries a lookup table and returns how many matching records were found.
oQueryCountFromPromptAction Queries the Prompt Action statistical database and returns how many matching records were found.
oQueryLookupTable Queries a lookup table and returns all data from the matching rows.
oQueryPromptAction Queries the Prompt Action statistical database and returns all data from the matching rows.
oReplaceAllDataInLookupTable Deletes all data from a lookup table and replaces it with the specified data.
oUpdateDataInLookupTable Changes all rows in a lookup table that match the specified conditions to the specified data. 

 

If you have any questions about how to use Genie Window Placement By Region please contact us at: genie@bookingbuilder.com