Archive
SWS UpdatePhone Method
Updates a rental contact’s phone number and returns a copy of the updated record.
Parameters
Name | DataType | Is Required |
---|---|---|
Active | Boolean | Optional |
Description | Updates the phone number to be active on the contact (“True”) or inactive on the contact (“False”). | |
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. | |
Phone | String | Optional |
Description | The rental contact’s phone number. | |
PhoneId | Long | Required |
Description | The phone number’s ID number that you wish to update. | |
PhoneType | PhoneType | Optional |
Description | Updates the phone number type. Available values:
|
Returned Parameters
Name | DataType |
---|---|
ACTIVE | Boolean |
Description | Indicates if the phone number is active for the contact (“True”) or not (“False”). |
CONTACT_ID | Long |
Description | The rental contact’s ID number. |
CREATED | DateTime |
Description | The date and time the phone record was originally created. |
CREATED_BY | Long |
Description | The user’s ID that originally created the phone record. |
PHONE | String |
Description | The phone number of the record that was updated. |
PHONE_ID | Long |
Description | The phone number’s ID number that was updated. |
PHONE_TYPE | Integer |
Description | The numeric value for the type of phone number. Available values:
|
UPDATED | DateTime |
Description | The date and time the phone record was last updated. |
UPDATED_BY | Long |
Description | The user’s ID that last updated the phone record. |
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, a Phone request object, and a Phone response object. We can define and create those like this:
// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.Phone_Request request = new SWS.Phone_Request();
SWS.Phone_Response response;
Here is a sample code of the request object (including optional parameters):
// UpdatePhone Request
request.PhoneId = 123456;
request.Phone = "800-555-1212";
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.UpdatePhone(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 UpdateAddress Method
Updates a rental contact’s address and returns a copy of the updated record.
Parameters
Name | DataType | Is Required |
---|---|---|
Active | Boolean | Optional |
Description | Indicates if the address will remain active on the account (“True”) or if you wish to deactivate it (“False”). The default value is “True” if left undefined. | |
Addr1 | String | Optional |
Description | The first address line of the contact’s address. | |
Addr2 | String | Optional |
Description | The second address line of the contact’s address. | |
Addr3 | String | Optional |
Description | The third address line of the contact’s address. | |
AddrId | Long | Required |
Description | The ID number of the address that will be updated. | |
AddrType | AddressType | Optional |
Description | Indicates the type of address. Available values:
|
|
City | String | Optional |
Description | The city of the address. | |
ContactId | Long | Optional |
Description | The rental contact’s ID number where the address is being updated. | |
Country | String | Optional |
Description | The country for the address. | |
PostalCode | String | Optional |
Description | The postal/ZIP code for the address. | |
State | String | Optional |
Description | The state/province for the address. |
Returned Parameters
Name | DataType |
---|---|
ACTIVE | Boolean |
Description | Indicates if the address is active (“True”) or not (“False”). |
ADDR_ID | Long |
Description | The rental contact’s address ID number. |
ADDR_TYPE | Integer |
Description | The numeric value for the address type. Available values:
|
ADDR1 | String |
Description | The first address line of the contact’s address. |
ADDR2 | String |
Description | The second address line of the contact’s address. |
ADDR3 | String |
Description | The third address line of the contact’s address. |
CITY | String |
Description | The city of the address. |
CONTACT_ID | Long |
Description | The rental contact’s ID number where the address was updated. |
COUNTRY | String |
Description | The country for the address. |
CREATED | DateTime |
Description | The date and time the address record was created. |
CREATED_BY | Long |
Description | The user’s ID that created the address record. |
POSTAL_CODE | String |
Description | The postal/ZIP code for the address. |
STATE | String |
Description | The state/province for the address. |
UPDATED | DateTime |
Description | The date and time the address record was last updated. |
UPDATED_BY | Long |
Description | The user’s ID that last updated the address record. |
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 ContactAddress request object, and an Address response object. We can define and create those like this:
// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.ContactAddress request = new SWS.ContactAddress();
SWS.Address_Response response;
Here is a sample code of the request object:
// UpdateAddress Request
request.AddrId = 123456;
request.AddrType = SWS.AddressType.HOME;
request.Addr1 = "1234 Main St.";
request.PostalCode = "88888";
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.UpdateAddress(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.