SmarterStats 6.x Help
This documentation is for a product that is no longer supported by SmarterTools.

Automation with Web Services

Who Should Use This Document

This document is intended for use by high-volume and automated businesses environments and hosting companies as they develop procedures to manage their SmarterStats system and work flow. In addition, this document assumes a basic understanding of Web service technologies and ASP.NET programming.

Automation with Web Services

SmarterStats was built with custom configuration and integration in mind. In addition to being able to customize the look and feel of SmarterStats, developers and/or system administrators have the ability to code to the SmarterStats application using Web services. These Web services allow developers and/or system administrators to automate a variety of different functions and tasks normally available through the product interface.

To view the available Web services and their corresponding functions, go to your Web interface install location and append "Services/SERVICENAME.asmx". These pages can also be used to view the SOAP definition for the Web services.

When you set up a Web reference to these Web services you will want to include the full path to your SmarterStats installation with the service name indicated in each section below (for example, http:// 127.0.0.1:9999/Services/SERVICENAME.asmx).

In the sections that follow, you will find a brief explanation of the available Web services, along with the default installation paths to the specific Web service details page.

Note that some Web service functions may have several numbered forms (ex. AddSite, AddSite2, AddSite3). These are so named to ensure backwards compatibility with legacy systems. For new development, SmarterTools recommends using the highest numbered version. 

Note: For a list of constants, refer to the Web Services Constants Reference.

Server Admin Web Service

Services/serveradmin.asmx

These services allow developers and/or system administrators to pull information relating to a server or servers from a custom page using SOAP, an HTTP GET command, or an HTTP POST command (examples for each are provided as well). The functions and their corresponding properties are:

  • GetServers: Returns a list of all servers running SmarterStats Enterprise.
  • GetGlobalDefaults: Returns the global default settings for a specific server. These default settings include server IP address, server status, default file, document and download extensions, and more.
  • PingServer: Allows you to ping a specific server and see the results.
  • DeleteServer: Allows you to delete a server from the Web interface.
  • AddServer: Allows you to add a server directly into the Web interface.
  • UpdateServer: Allows you to change server configurations on the fly.

Site Admin Web Service

Services/siteadmin.asmx

These services allow developers and/or system administrators to pull information relating to a particular site or sites from a custom page using SOAP, an HTTP GET protocol, or an HTTP POST command (examples for each are provided as well). These functions and their corresponding properties are:

  • AddSite3: Allows you to add sites to the Web interface on the fly.
  • AddSiteWithFTP2: Allows you to add a site with FTP logs directly in to the Web interface.
  • DeleteSite: Allows you to delete a site from the Web interface on the fly.
  • GetAllSites2: Returns a listing of all sites being monitored by the Web interface.
  • GetSitesForServer2: Returns sites from a particular Server ID.
  • GetSite2: Returns a single site that you specify and that is listed in the Web interface.
  • GetSiteStatus: Allows you to check the site status for a particular Site ID.
  • GetRequestedSettings: Allows you to retrieve certain settings for a Site. Requesting a blank list of settings will cause SmarterStats to return settings for all known keys.
  • MoveSite2: Allows you to initiate a move command to the service for a particular site. This would allow you to automate moves within a control panel application.
  • SetRequestedSettings: Allows you to set certain settings for a Site. For a list of all keys, request a blank list of settings from GetRequestedSettings.
  • UpdateSite3: Allows you to update information pertaining to a particular site that resides in the Web interface.

Bandwidth Web Service

Services/bandwidth.asmx

These services allow developers and/or system administrators to pull information relating to bandwidth usage for a particular site or server from a custom page using SOAP, an HTTP GET command, or an HTTP POST command (examples for each are provided as well). These functions can be extremely useful when providing bandwidth statistics to end users or for bandwidth monitoring and overage billing. The functions and their corresponding properties are:

  • GetForSite: Returns all bandwidth for a particular site.
  • GetForServer: Returns all bandwidth for a particular server on a per-site basis.

Diagnostics Web Service

Services/Diagnostics.asmx

These services allow developers and/or system administrators to check on the current status of sites from a custom page using SOAP, an HTTP GET command, or an HTTP POST command (examples for each are provided as well). The functions and their corresponding properties are:

  • GetSiteStatusForServer: Allows you to get information about the current import status of all sites on a server.

Statistics Web Service

Services/Statistics.asmx

These services allow developers and/or system administrators to pull information about site activity from a custom page using SOAP, an HTTP GET command, or an HTTP POST command (examples for each are provided as well). The functions and their corresponding properties are:

  • GetActivityForServer: Returns activity stats (hits, visits, views, and bandwidth) for all sites on a server.
  • GetActivityForSite: Returns activity stats for a particular site.

Global Update Web Service

Services/svcGlobalUpdate.asmx

These services allow developers and/or system administrators to quickly set site settings across an entire installation from a custom page using SOAP, an HTTP GET command, or an HTTP POST command (examples for each are provided as well). This may be used to enforce a new policy across a large installation. The functions and their corresponding properties are:

  • ListGlobalUpdateFields: Returns a list of all fields that can be configured through this web service and any caveats about their parameters.
  • UpdateAllDomainSettings: Begins the process of setting the specified properties on all sites of the installation.
  • GetGlobalUpdateStatus: Gets the status of the process that is performing the action previously started in UpdateAllDomainSettings.

Product Information Web Service

Services/productinfo.asmx

  • ActivateLicenseKey: Allows you to activate the license key purchased for your product.
  • GetLicenseInfo: Returns information pertaining to the current product license.
  • GetProductInfo: Returns information pertaining to the currently installed product.
  • SetLicenseKey: Sets a license key for the Web interface.

User Administration Web Service

Services/useradmin.asmx

These services allow developers and/or system administrators to perform various user functions, such as user creation and deletion, updating user information, retrieving user information and more from a custom page using SOAP, an HTTP GET command, or an HTTP POST command (examples for each are provided as well). The functions and their corresponding properties are:

  • AddUser: Automatically adds users to a specific site.
  • SetSiteOwner: Sets site ownership for a specific site to a specific user.
  • GetUser: Returns a user for a particular site.
  • ValidateLogin: Returns login results for a particular user.
  • GetUsers: Returns all users for a specific site.
  • UpdateUser: Updates user information for a site.
  • DeleteUser: Deletes the specified user from a site.  

Important Notices

The recommendations in this document reflect the opinions of its author(s) only and are based upon their knowledge and experience. No warrantee or guarantee is expressed or implied as to the efficacy or applicability of the information in this document for a particular environment or application. SmarterStats, SmarterTools, and their respective logos are trademarks of SmarterTools Inc. All other trade-names and/or trademarks in this document are the property of their respective owners.

Comments and suggestions regarding the contents of this document should be sent to editor@smartertools.com.