SWS GetGateCodeInfo Method
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.