BackgroundThe QBO3 RESTful API is based on a set of C# classes and the methods implemented in the class, and customized from site to site as power users and developers create Statements and Services. Definitions- Module: a C# class backed by a SQL table, such a Attachment, Contact, Message, Loan, etc.
- Handler: an ASP.NET HttpHandler (.ashx file) that acts as a URI endpoint for a module (e.g. Message.ashx)
- Method: a C# method that may be invoked via the RESTful API
- Statement: a SQL snippet (similar to a stored procedure) that may be invoked via the RESTful API
- Service: a .NET managed code plugin that may be invoked via the RESTful API
- Operation: a method, statement, or service
- Parameters: a dictionary (or query string) of name value pairs to pass to an operation
Invoking the APIInvoking the QBO3 API via a web browser synchronously is done with the following syntax:
{Handler}/{Operation}?{Parameters}
Message.ashx/Save?Subject=Hello World&BodyText=This is my first message
Attachment.ashx/Search?FileName=HelloWord.pdf
Contact.ashx/Geocode?Address=123 Main Street&PostalCode=92101
Invoking the QBO3 API via a web browser asynchronously is done with the following syntax:
{Handler}/Queue/{Operation}?{Parameters}
Message.ashx/Queue/Send?Subject=My First Email&BodyText=Hello there
Attachment.ashx/Queue/PurgeHistory
When invoke a QBO3 handler, there are several reserved parameters: - Transform: if specified, this dictates an XSLT to use when rendering the results. If not specified, if the underlying operation is pre-defined to use a transform, that will be used, otherwise XML will be returned
- Output: if specified, this dictates how to deliver the results. Valid values include Html (default), Xml, Json, CSV and Excel
- QueueName: if specified with a Queue operation
Invoking the QBO3 API from the application tier is done by many of the QBO3 template classes, including DecisionTemplate (workflow), AttachmentTemplate (document generation), and MessageTemplate:
{Module}/{Operation}?{Parameters}
Loan/Summary?ID=17
Contact/Geocode?ID=18,19,22
Attachment/Generate?Object=Contact&ObjectID=55&Template=Welcome Letter
Extending the APIYou can extend the QBO3 API via the web browser by adding a Statement or Service. Methods are compiled in C# code, and are thus not extensible via the web browser.
To see a list of possible API operations: - Navigate to Design > Configuration > Modules
- Choose a module you want to invoke API calls against
- From the module's Advanced panel, review the Statements, Methods, and Services tabs
If there exists a method, statement and service each with the same name, the winner will be method (if it exists), else service, else statement. Thus, the Summary method (defined in C#) may leverage a Summary statement (SQL snippet) to drive some of it's behavior.
|
|