Archive

Archive for the ‘Gates’ Category

SWS UpdateOverlockStatus Method

Lets you change the overlock status for a rental item. Multiple rental items can be individually processed with a new status. If a rental item’s ID is passed in but a status does not get passed in, the status will default to NOT_OVERLOCKED.

Parameters

Name DataType Is Required
OrgID Long Required
Description The organization’s ID number.
RentalID Long Required
Description The rental item’s ID number. This is returned when using the MakeReservation method or can be searched for using the SearchBy method.
Status Status Required
Description The overlock status to which you are updating the rental item.
Available values:

  • NOT_OVERLOCKED
  • PENDING_OVERLOCK
  • OVERLOCKED
  • PENDING_LOCK_REMOVAL

Returned Parameters

Name Data Type
RentalID Long
Description The rental’s ID number.
Succeeded Boolean
Description Indicates if the update succeeded (“True”) or not (“False”).
ErrorMessage String
Description If the update wasn’t successful, you will get an error message with why the update was unsuccessful.

Example

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

We will assume you have a web reference, let us name it SWS, in your Visual Studio project. At this point we need to define our objects.  We will need the standard service object, an UpdateOverlockStatus request object, and an UpdateOverlockStatus response object. We will also need an array of RentalOverLock objects. One for each rental to adjust. We can define and create those like this:

// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.UpdateOverlockStatus_Request request = new SWS.UpdateOverlockStatus_Request();
SWS.UpdateOverlockStatus_Response response;

SWS.RentalOverlockData[] overLock = new SWS.RentalOverlockData[1];

Here is a sample code of the request object:

// UpdateOverlockStatus Request
overLock[0].RentalID = 123456;
overLock[0].Status = SWS.OverlockStatus.OVERLOCKED;

request.OrgID = 123456;
request.OverlockData = overLock

Finally we can call the method and pass across the login object and the request object to retrieve our requested information. It’s a good idea to do this in a Try Catch block.

' Call the method that will load the response object
try
{
  response = service.UpdateOverlockStatus(user_request, request);
}
catch (Exception ex)
{
  MessageBox.Show(ex.Message);
}

Note that if something goes wrong the service will respond with an exception. You will want to capture the message in the exception so it can be debugged.

For a full list of methods see SWS Methods.

SWS GetGateCodeInfo Method

May 17, 2011 Leave a comment

Retrieves a collection of gate code data for a specified rental contact, rental or potential rental.

Parameters

Name DataType Is Required
ContactID Long Optional*
Description The rental contact’s ID number. This is returned when using the CreateNewAccount or AddNewContact methods or you can search for it using the SearchBy method.
*At least one of these parameters is required: ContactID, RentalID, UnitID.
RentalID Long Optional*
Description The rental item’s ID number. This is returned when using the MakeReservation method or can be searched for using the SearchBy method.
*At least one of these parameters is required: ContactID, RentalID, UnitID.
UnitID Long Optional*
Description The unit’s ID number. This is returned when you use any of the GetSiteUnitData calls and is maintained through rentals.
*At least one of these parameters is required: ContactID, RentalID, UnitID.

Returned Parameters

Name DataType
ACCESS_LEVEL String
Description Indicates if the contact has access to the rental (“ALLOWED”) or not (“NONE”).
ACTIVE String
Description Indicates if the contact is currently active for the rental (“Y”) or not (“N”).
CONTACT_ID Long
Description The rental contact’s ID number.
FIRST_NAME String
Description The given name for the rental contact.
GATE_24 String
Description Indicates if the contact has 24 hour access to the unit (“Y”) or not (“N”).
GATE_CODE String
Description The contact’s gate code number.
GATE_KEYPAD String
Description The keypad zone to which the tenant is assigned in the gate software.
GATE_LOCKOUT String
Description Indicates if the tenant has access through the gates (“Y”) or if they have been locked out (“N”).
GATE_TIMEZONE String
Description The gate’s timezone to which the customer is assigned..
LAST_NAME String
Description The family name for the rental contact.
PRIMARY_FLAG String
Description Indicates if the contact is the primary contact for the rental (“Y”) or not (“N”).
RENTAL_ID Long
Description The rental item’s ID number.
UNIT_ID Long
Description The unit’s ID number. This is maintained through rentals.

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 GetGateCodeInfo request object and a GetGateCodeInfo response object. We can define and create those like this:

// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.GetGateCodeInfo_Request request = new SWS.GetGateCodeInfo_Request();
SWS.GetGateCodeInfo_Response response;

Here’s my sample code of the Request using the rental ID object.

// GetGateCodeInfo Request
request.RentalID = 123456;

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

// Call the method that will load the response object
try
{
  response = service.GetGateCodeInfo(user_request,request);
}
catch (Exception ex)
{
  MessageBox.Show(ex.Message);
}

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.

For a full list of methods see SWS Methods.

Categories: API General, Gates Tags: ,