als_insert_client.cgi

Top  Previous  Next

Description

The als_insert_client.cgi interface inserts a new client into the AL-Desk Client table. The primary key of the Client table is an Integer field named Code. Upon successful insertion the new data is returned as XML including the unique identifier for the new client.That identifier can be used to update the client row using the als_update_client.cgi method.

 

Client information includes the optional fields of arrival and departure date. It is common in the travel industry to consider the same clients as new clients when they return for another visit.

 

You also may want to require arrival and departure dates and check them when users book an activity (write a voucher). Currently the Web Portal API does no error checking when writing a voucher as to whether the arrival and departure date match an activity date.

 

A valid client code is required to create vouchers.

 

As is normal for all Put calls a valid webusercode is required.

 

Client information can be fetched using als_get_client.cgi

 

All client changes, including inserts and updates are logged so that AL-Desk Audit trail changes are preserved.

 

Example Usage          

 

http://127.0.0.1/als_insert_client.cgi?webusercode=1&lastname=browningd&email=aaaa@hotmail.com&arrivaldate=2005-05-21&departuredate=2005-05-31&cellphone=12345&faxphone=12361&homephone=43212

 

Inputs

Parameter

Description

Required

Example

Data Type

webusercode

Code from WiUsers required for insert access

 

Required

code=5

Integer

lastname

Last Name of the Client

 

Required

lastname=Smith

String

firstname

First Name of the client

 

Optional

firstname=John

String

email

Email of the Client

 

Optional

email=jsmith@gmail.com

String

hotel

Hotel Code of the Client

using a valid code from als_get_hotels.cgi

 

Optional

hotel=1

Integer

room

Room of the Client

Optional

room=200

String

homephone

Home Phone of the Client

 

Optional

homephone=

415-323-2322

String

faxphone

Fax of the Client

 

Optional

faxphone=

415-634-3222

String

cellphone

Client Cell Phone

 

Optional

cellphone=

415-654-2322

String

workphone

Client Work Phone

 

Optional

workphone=

415-323-2331

String

otherphone

Client Other Phone

Optional

otherphone=

415-987-4422

String

notes

Any Notes for the Client

 

Optional

notes=

hello%20world

 

Note: spaces must be escaped for http inputs

String

arrivaldate

Arrival Date of the Client

 

Optional

arrivaldate=

2005-05-31

Date

depaturedate

Departure Date of the Client

 

Optional

depaturedate=

2005-06-10

Date

 

 

Returned Fields

#

Field Name

Description

Data Type

1

Code

AL-Desk Associated Code

Integer

 

 

 

 

 

XML Example

 

Note: the important field returned is the code field that contains the unique id for the new client added to the table.

 

<?xml version="1.0" encoding="utf-8" ?>

- <root>

- <client>

<row code="102815" name="smith, john" firstname="john" lastname="smith" hotel="1" room="102" arrivaldate="11/1/2005" departuredate="11/30/2005" homephone="208.342.7800" notes="added via web interface Hotel:Kaanapali Villas" lastvoucher="0" email="test@hello.com" faxphone="208.389.4643" cellphone="208.890.5859" otherphone="208.861.6841" workphone="208.342.7800" hotelname="Kaanapali Villas" />

</client>

</root>