Archive
SWS UpdateContact Method
Updates a rental contact and returns a copy of the updated record. This method does not update addresses or phone numbers. Use UpdateAddress or UpdatePhone to update that portion of the contact information.
Parameters
Name | DataType | Is Required |
---|---|---|
AcctID | Long | Optional |
Description | The account’s ID number. This is returned when you use the CreateNewAccount method or can be retrieved with the SearchBy method. | |
Active | Boolean | Optional |
Description | Sets the contact to active (“True”) or deactivates a contact (“False”). | |
Addresses | ContactAddress | Not used |
Description | The collection of address data. (This data will not be updated in this method. See UpdateAddress to update the contact’s address(es).) | |
Cflex01 | String | Optional |
Description | A custom field, set up by the organization, designed to hold additional contact information. This is not displayed in the Store application. Max string length of 100. | |
Cflex02 | String | Optional |
Description | A custom field, set up by the organization, designed to hold additional contact information. This is not displayed in the Store application. Max string length of 100. | |
Cflex03 | String | Optional |
Description | A custom field, set up by the organization, designed to hold additional contact information. This is not displayed in the Store application. Max string length of 100. | |
Cflex04 | String | Optional |
Description | A custom field, set up by the organization, designed to hold additional contact information. This is not displayed in the Store application. Max string length of 100. | |
Cflex05 | String | Optional |
Description | A custom field, set up by the organization, designed to hold additional contact information. This is not displayed in the Store application. Max string length of 100. | |
ContactId | Long | Required |
Description | The rental contact’s ID number that is being updated. | |
ContactType | ContactType | Optional |
Description | The type of contact to which it will be changed. Available values:
|
|
DLNumber | String | Optional |
Description | The rental contact’s driver’s license number. Max string length of 35. | |
DLState | String | Optional |
Description | The issuing state/province for the drivers license. Max string length of 20. | |
DOB | String | Optional |
Description | The rental contact’s date of birth. The date format is based on your coding software’s parameters. Max string length of 20. | |
EcommCode | String | Optional |
Description | Updates the rental contact’s alpha-numeric eStore password/eCommerce password. Max string length of 30. | |
String | Optional | |
Description | The email address for the account or primary contact. This is also used as a username if the site supports eStore or eCommerce. Max string length of 100. | |
Employer | String | Optional |
Description | The rental contact’s employer. Max string length of 75. | |
FirstName | String | Optional |
Description | The given name for the contact. Max string length of 50. | |
KnownAs | String | Optional |
Description | The alternate or nick name for the rental contact. Max string length of 50. | |
LastName | String | Optional |
Description | The family name for the contact. Max string length of 50. | |
Phones | ContactPhone | Not used. |
Description | The phone number(s) for the contact. (This date will not be updated using this method. See UpdatePhone to update the contacts phone number(s). | |
SSN | String | Optional |
Description | The rental contact’s social security number. Max string length of 20. |
Returned Parameters
Name | DataType |
---|---|
ACCT_CONTACT_ADDRESSES | ACCT_CONTACT_ADDRESSES |
Description | A collection of address data associated with the rental contact. |
ACCT_CONTACT_PHONES | ACCT_CONTACT_PHONES |
Description | A collection of phone data related to the contact. |
ACCT_ID | Long |
Description | The account’s ID number. |
ACTIVE | Boolean |
Description | Indicates if the contact is active (“True”) or not (“False”). |
CFLEX01 | String |
Description | A custom field, set up by the organization, designed to hold additional contact information. This is not displayed in the Store application. |
CFLEX02 | String |
Description | A custom field, set up by the organization, designed to hold additional contact information. This is not displayed in the Store application. |
CFLEX03 | String |
Description | A custom field, set up by the organization, designed to hold additional contact information. This is not displayed in the Store application. |
CFLEX04 | String |
Description | A custom field, set up by the organization, designed to hold additional contact information. This is not displayed in the Store application. |
CFLEX05 | String |
Description | A custom field, set up by the organization, designed to hold additional contact information. This is not displayed in the Store application. |
CONTACT_ID | Long |
Description | The rental contact’s ID number. |
CONTACT_TYPE | Integer |
Description | The numeric value for the contact type. Available values:
|
CREATED | DateTime |
Description | The date and time the contact was initially created. |
CREATED_BY | Long |
Description | The user’s ID that initially created the contact. |
DL_NUMBER | String |
Description | The rental contact’s driver’s license number. |
DL_STATE | String |
Description | The issuing state/province for the drivers license. |
DOB | String |
Description | The rental contact’s date of birth. The date format is based on your coding software’s parameters. |
ECOMM_CODE | String |
Description | No longer returned. |
String | |
Description | The email address for the account or primary contact. This is also used as a username if the site supports eStore or eCommerce. |
EMPLOYER | String |
Description | The rental contact’s employer. |
FIRST_NAME | String |
Description | The given name for the contact. |
KNOWN_AS | String |
Description | The alternate or nick name for the rental contact. |
LAST_NAME | String |
Description | The family name for the rental contact. |
SSN | String |
Description | The contact’s masked social security number. |
UPDATED | DateTime |
Description | The date and time that the contact was last updated. |
UPDATED_BY | Long |
Description | The Store user’s ID number that last updated the contact. |
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 Contact request object, and a Contact response object. We can define and create those like this:
// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.Contact_Request request = new SWS.Contact_Request();
SWS.Contact_Response response;
Here is a sample code of the request object (including some optional parameters):
// UpdateContact Request
request.AcctID = 123456;
request.ContactId = 123456;
request.Email = "j.doe@a.c";
request.EcommCode = "TestPass";
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.UpdateContact(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 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.
SWS CreateNewAccount Method
Creates an account and a primary contact, including addresses and phone numbers for the account/contact.
Parameters
Name | DataType | Is Required |
---|---|---|
OrgID | Long | Required |
Description | The organization’s ID number. | |
SiteID | Long | Required |
Description | The site’s ID number. This can be found using the GetSiteList method. | |
FirstName | String | Required |
Description | The first name of the primary contact on the account. | |
LastName | String | Required |
Description | The last name of the primary contact on the account. | |
AccountName | String | Optional* |
Description | The name on the account. This may differ from the primary contact’s name in some instances, such as a business account or a guardianship account. Max string length of 150. *Required if this is a business account. The Account Name will reflect the business and the contact name will be for the specific contact. If this is a personal account, the account name will be inferred as the contacts last name, first name. |
|
AccountClass | AccountClass | Required |
Description | The class of the account. Available values:
|
|
ContactType | ContactType | Required |
Description | The type of account. Most users should be set as ACCOUNT_MANAGER. Available values:
|
|
String | Optional | |
Description | The email where the customer would like to receive correspondence. This also acts as the username if the site supports eStore/eCommerce. Max string length of 100. | |
ContactAddress | ContactAddress | Required |
Description | The object containing the required information for the contact’s address record. | |
ContactPhone | ACCT_CONTACT_PHONE | Required |
Description | The object containing the required information for the contact’s phone number record. | |
EcommCode | String | Optional |
Description | The rental contact’s alpha-numeric password/eCommerce code. Defining this parameter will automatically register the customer for eStore/eCommerce. | |
BLACKLIST_SMS | Boolean | Optional |
Description | Sets the customer to allow SMS text messages to their phone (“False”) or removes their number from the SMS list (“True”). Defaults to “False”. If they are added on one account it will apply to all the accounts with their phone number at the organization. |
Returned Parameters
Name | DataType |
---|---|
AccountID | Long |
Description | The account’s ID number. |
ContactID | Integer |
Description | The rental contact’s ID number. |
Addresses | ACCT_CONTACT_ADDRESSES |
Description | The object containing the contact’s address information. |
Phones | ACCT_CONTACT_PHONES |
Description | The object containing the contact’s phone information. |
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 CreateNewAccount request object and a CreateNewAccount response object. We can define and create these like this:
// Create request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.CreateNewAccount_Request request = new SWS.CreateNewAccount_Request();
SWS.structCreateAccount response;
SWS.ContactAddress address = new SWS.ContactAddress();
SWS.ACCT_CONTACT_PHONES phone = new SWS.ACCT_CONTACT_PHONES();
Here’s my sample code of the Request object.
// new address object address.Addr1 = "1234 Main St"; address.Addr2 = "Apt. B"; address.City = "My Town"; address.State = "UT"; address.PostalCode = "55555"; address.Country = "USA"; address.AddrType = SWS.AddressType.HOME; address.Active = true; // new phone object phone.PHONE = "800-555-1212"; phone.PHONE_TYPE = SWS.PhoneType.MOBILE; // new acct request request.OrgID = 123456; request.SiteID = 123456; request.FirstName = "FirstName"; request.LastName = "LastName"; request.AccountName = "LastName, FirstName"; request.AccountClass = SWS.AccountClass.PERSONAL; request.ContactType = SWS.ContactType.ACCOUNT_MANAGER; request.Email = "email@co.com"; request.EcommCode = "mypassword"; request.ContactAddress = new SWS.ContactAddress[]{ address}; request.ContactPhone = new SWS.ACCT_CONTACT_PHONES[] { phone };
Finally we can call the method and pass across the login object and the request object to create our new account. It’s a good idea to do this in a Try Catch block.
Try // Call the method that will load the response object try { response = service.CreateNewAccount(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.