Home > API General, Rental/Reservation, Site Administration > SWS GetSiteUnitData Method

SWS GetSiteUnitData Method


Retrieves a list of available rental items. Based on the parameters, it will retrieve the first unit available for the parameters requested. This will also return promotions for the items, if requested.

Parameters

Name DataType Is Required
Depth Decimal Optional
Description The depth of the rental item.
GetPromoData Boolean Required
Description Indicates you want to retrieve promotions with the unit data (“True”) or not (“False”).
HardReservable String Optional
Description Limits the return to only those units flagged as available for a hard reservation.
MaxRentRate Decimal Optional
Description Limits the results to only those units below the maxiumum rent rate in this parameter.
MinAvailable Integer Optional
Description Limits the return to only those unit types that have more than this number available.
MinRentRate Decimal Optional
Description Limits the results to only those units above the minimum rent rate in this parameter.
PromoDataType PCDTypeOptions Optional
Description The type of promotions you want returned.
Available values:

  • None
  • HighestPriorityPromotion
  • AllPromotions
  • HighestPriorityDiscount
  • AllDiscounts
  • HighestPriorityRateMod
  • AllRateMods
  • All
  • HighestPriorityDiscountandPromo
  • HighestPriorityPCDAndRateMod
SiteID Long Required
Description The site’s ID number. This can be found using the GetSiteList method.
SoftReservable String Optional
Description Limits the return to only those units flagged as available for a soft reservation.
Width Decimal Optional
Description The width of the rental item.

Returned Parameters

Name DataType
AVAILABLE Decimal
Description The total number of rental items available at the site.
CLASS_DESC String
Description The description of the site’s revenue class.
CURRENT_RATE Long
Description The current rent rate.
DEPTH Decimal
Description The depth of the rental item.
FEATURES_VAL String
Description The “Features” custom lookup value as defined by the site.
HARD_RESERVATION String
Description Indicates that the rental is available to be place on a hard reservation (“Yes”) or that it is not available for a hard reservation (“No”).
MAX_RENT_RATE Decimal
Description The maximum rent rate that can be charged for the rental item, determined by the admin.
MIN_RENT_RATE Decimal
Description The minimum rent rate that can be charged for the rental item, determined by the admin.
OBJ_PERIOD_UOM_VAL String
Description The description for the “Unit of Measure” (UOM) for the rental cycle. Currently the only option is “Month”.
PROMO_DESC String
Description The promotion, discount or rate modification’s description, if GetPromoData was set to “True”.
PROMO_DET String
Description The details of the current available promotion for the rental item, if GetPromoData was set to “True”.
PROMO_ID Decimal
Description The promotion’s ID number.
PROMO_NAME String
Description The promotion, discount or rate modification’s name.
PromoCollection PCDItem
Description The object containing all the information about the promotion/s.
QUANTITY Decimal
Description The total number of the specific rental items at the site.
RES_AMOUNT Decimal
Description The hard reservation deposit amount.
SITE_CLASS_ID Long
Description The site’s revenue class ID number.
SITE_ID Long
Description The site’s ID number.
SOFT_RESERVATION String
Description Indicates that the rental is available to be place on a soft reservation (“Yes”) or that it is not available for a soft reservation (“No”).
UNIT_ID Decimal
Description The unit’s ID number. This is maintained through rentals.
UNIT_NUMBER String
Description The unit’s number as assigned by the organization. This is not the UnitID.
VERSION Decimal
Description The unit’s version number which serves to prevent duplicate use of the unit. This is returned when you use any version of GetSiteUnitData or the GetUnitData method.
WIDTH Decimal
Description The width of the rental item.

Example

As with every method we need to pass in credentials. We do this with the LookupUser request object.

We’ll assume you’ve got a web reference, let’s name it SWS, in your Visual Studio project.  At this point we need to our objects.  We’ll need the standard service object, a GetSiteUnitData request object and a GetSiteUnitData response object. We can define and create those like this:

   ' Create a request and response objects
 Dim objService As New SWS.WSSoapClient
 Dim objReq As New SWS.GetSiteUnitData_Request
 Dim objRes As New SWS.GetSiteUnitData_Response

Here’s my sample code of the Request object.

 ' GetSiteUnitData Request
 With objReq
 .SiteID = 1000000001
 .GetPromoData = N
 .HardReservable = Y
 End With

Finally we can call the method and pass across the login object and the request object to get our site unit data. It’s a good idea to do this in a Try Catch block.

Try
    ' Call the method that will load the response object
 objRes = objService.GetSiteUnitData(objLogin, objReq)
 Catch ex As Exception
    MessageBox.Show(ex.Message)
 End Try

Note that if something goes wrong the service will respond with an exception. You’ll want to take a look at that message returned in that exception so it can be debugged.

Each organization has the ability to limit when a reservation can be made.
These limiting factors can be found at GetSiteRules.

For a full list of methods see SWS Methods.

  1. James
    December 2, 2013 at 3:34 pm

    In the new GetSiteUnitData_v2 method, https://centershiftdevx.com/2013/03/27/getsiteunitdatav2/ states…

    This function retrieves a collection of unit type for a specific group of units. Unlike version one the unit are grouped by Width, Depth, Height, Attribute 1, Attribute 2, Climate, Door, Access and Feature values. You will have all the vital data on a randomly selected unit from each group including additional data items. Still missing data you are looking for? Check out GetUnitDataWithPromos all available rent item data is returned there. There are also additional filtering options including the ability to pass in multiple values for various filters. Unfiltered, this method will return all rental items with NO promos.

    The “randomly selected unit” part appears to cause the UnitID for a given unit type to change sporadically over time. Comparing the UnitID value returned for a particular unit in the GetSiteUnitData_v2 method versus the same unit returned using the original GetSiteUnitData method for the same store, the UnitID is different between the 2 calls.

    Why are those UnitIDs different? Do the UnitId values returned via the original GetSiteUnitData method stay the same for each unit type?

  2. swsBecky
    April 5, 2017 at 12:01 pm

    Updated Oct. 29,2015: Previously this function was not returning the promotion description value as was intended. The promotion description value will be returned correctly.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s