Accessing Reports Programmatically

Many of the reports within SOLO Server can be accessed programmatically through standard HTTP GET or POST requests in order to allow integration with custom reporting tools.

The following list outlines which reports are accessible through this mechanism and the required User permissions:

Report Type Supported Reports Required User Permission
Licenses All Reports except Licenses by Distributor Report Access
Auditing Exports All Reports

Authors: Master User ID

Licenses: (see Auditing Exports)

Products, Product Options: View Products

Users: Manager Users

Trial Tracking All Reports Report Access
Uncompleted Store Orders No Reports currently supported  
Accounting No Reports currently supported  
Account Statements All Reports Accounting Reports
Customers All Reports Report Access
Store Sales All Reports except
Sales with Invoice Details and
Unit Compare By Distributor Type
Sales Reports Access or Financial Access

Report Integration

To integrate your internal reporting application with SOLO Server, you simply need to call the appropriate SOLO Server reporting URL using either an HTTP GET or POST request containing authentication parameters along with report input parameters such as the report type and start and end date. SOLO Server will reply with a response which the calling application can then process accordingly.

Important

Since this approach requires providing an AuthorID, API UserID, and API User Password as inputs, it should be used for internal applications only and should not be called by client applications distributed to customers. Using this web method in a client application exposes a security risk as this would require including these credentials in the distributed product.

If you are currently using regular UserID and UserPassword credentials, you will need to update your application(s) to use an API UserID and API UserPassword instead, as support for the regular User ID and Password will be removed in the future.

Common Input Parameters

Parameter Data Type Required/Optional Description
WebServiceLogin boolean Required Must be set to "True". This parameter flags the request as a "web service" request, and instructs the request to be authenticated through the following three parameters rather than through session cookies.
AuthorID int Required SOLO Server Author ID.
UserID string Required The API User ID of the user from the given author using the service (previously the regular User ID). The API User ID and Password need to be used, as support for the regular User ID and Password will be removed in the future.
UserPassword string Required The API User Password for API User ID (previously the regular User Password for the User ID). The API User ID and Password need to be used, as support for the regular User ID and Password will be removed in the future.
ReportType string Required The format to generate the report in. This can be one of the following values:
  • Pdf - Adobe Acrobat
  • Xls - Microsoft Excel
  • Csv - Comma Separated Value
  • XmlElements - XML document with separate elements for each field in each record
  • XmlParameters - XML document with a single element containing an attribute for each field for each record

Note that some reports do not support all report types. You can reference the topic on each specific report to see the supported report types for each.

StartDate date Required Start date of the report date range. This should be in MM/dd/yyyy format.
EndDate date Required End date of the report date range. This should be in MM/dd/yyyy format.

Report Specific Parameters

In addition to the common input parameters, each report has it's own set of additional reporting parameters specific to the given report. You can determine the additional parameters for each report by examining the HTML source of the report form as follows:

Example - Licenses By Product Report

As a example, consider retrieving the output of the Licenses By Product Report in Excel format for the month of January 2012 for licenses with OK status, using a Status Check Days Back setting of 30 days and sorting by entered date. The URL and querystring or form data is put together as follows:

So, given this information, and assuming we are using AuthorID 123456 along a UserID of "Reporting" with a password of "testing", the querystring or form data to post would come together to the following (prior to HTML encoding):

Querystring/Post Data
WebServiceLogin=True&AuthorID=123456&UserID=Reporting&UserPassword=testing&ReportType=Xls &StartDate=1/1/2012&EndDate=1/31/2012&FilterOKStatus=True&StatusCheckDaysBack=30&SortBy=1

Report Output

If all input parameters to the report are valid, SOLO Server will return the report file as an attachment to the caller in the selected file format. If, however, there are any invalid or missing input parameters, SOLO Server will instead return an xml response to the caller with details on why the request failed. The xml response document is in the following format.

XML
<RequestError>
<ErrorType></ErrorType>
<InvalidParameters>
<InvalidParameter>
<Name></Name>
<Value></Value>
<Reason></Reason>
</InvalidParameter>
</InvalidParameters>
</RequestError>

The value of these elements is as follows:

Parameter Data Type Description
ErrorType string The type of error which occurred. Can be one of the following values:
  • AuthenticationFailure - Authentication of the AuthorID/UserID/UserPassword combination failed.
  • AccessDenied - The UserID does not have the appropriate permission to access the report.
  • InvalidParameters - One of more of the input parameters is missing or invalid. For this error type, the InvalidParameters element described below is also included in the document, and will contain an InvalidParameter element for each missing/invalid parameter describing why the parameter is invalid.
InvalidParameters XML child element This is a container element holding one or more InvalidParameter child elements, each containing details on why the given parameter is invalid.
Name string The name of the invalid/missing parameter.
Value string The value passed for the invalid parameter.
Reason string A string description of why the parameter is invalid.

Sample Code

For sample code demonstrating this functionality, contact us.