Home > API General, Reports, Site Administration > SWS GetOrgList Method

SWS GetOrgList Method


Retrieves the Org identification data, based on the organizations the user has access to.

Parameters

Name Data Type Is Required
LookupUser LookupUser Required
Description This is the same LookupUser information used for other calls. This is all that is required for this method.

Returned Parameters

Name DataType
AddressLine1 String
Description The first line of the address.
AddressLine2 String
Description The second line of the address.
AppDisplayName String
Description The name of the organization as it appears in Store.
City String
Description The city of the organization’s address.
Country String
Description The country of the organization’s address.
Email String
Description The organization’s email address.
Fax String
Description The fax number for the organization.
OrgID Long
Description The organization’s ID number.
OrgName String
Description The organization’s name.
Phone String
Description The organization’s phone number.
PostalCode String
Description The postal/ZIP code for the organization’s address.
Primary Boolean
Description Indicates if the organization is the user’s primary organization (“True”) or not (“False”).
State String
Description The state/province of the organization’s address.

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.  We’ll need the standard service object and a GetOrgList response object.

// Create a response object
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.GetOrgList_Response response;

We can call the method and pass across the login object to get our org list. 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.GetOrgList(user_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.

  1. swsBecky
    November 30, 2016 at 4:27 pm

    Currently, the phone and fax numbers are not being returned. No ETA on a fix.

  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 )

Google photo

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

Twitter picture

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

Facebook photo

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

Connecting to %s

%d bloggers like this: