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. |
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.
Categories: API General, Reports, Site Administration
Admin, Org Admin
Currently, the phone and fax numbers are not being returned. No ETA on a fix.