Skip to main content
There are two response levels: raw HTTP responses from the Agent API and the objects assembled by its JavaScript helpers. Field names are case-sensitive. The examples below illustrate structure; report IDs, parameters, columns, and values depend on your report.

HTTP query envelopes

Information Query returns an envelope:
This discovery example omits XML metadata and other node attributes. Always inspect ok, even after HTTP success. Failed queries can include errorText, errorType, errorCode, and ErrorElement. XML is represented as JSON using these conventions: Normalize absent, single, and repeated elements before iteration:
The GetReports helper reduces the matching report nodes to a string array. The raw HTTP envelope is not itself that array.

Parameter forms

Parameter retrieval returns an XMPP data form in Stanza.x. The JavaScript helper returns that form directly. Illustrative form, with XML metadata omitted:
Honor any validation information in the form. Do not assume every report accepts dates, the same date format, or the same field names. Preserve hidden fields. Fixed fields describe the form rather than requesting user input. An actual empty form can be submitted with no fields; a missing form should be investigated.

Assembled JavaScript results

ExecuteReport returns a completed query record assembled from progress events. This illustrative result contains one section and one table. A report can contain multiple tables, nested sections, and generated objects.
Section Items can contain nested sections, tables, objects, and messages. A table can appear in a section and in Tables; these are two ways to access the same output, not two separate tables. Messages have Type: "Message", Level, and Text. Inspect their levels and text; they are not all copied into Errors. The helper removes Status when the query ends. Do not require it in a completed result. An HTTP execution acknowledgment never contains this assembled object.

Read tables and cells

Columns defines display order. Each entry in Records is a row array in that same order: Records[rowIndex][columnIndex] belongs to Columns[columnIndex]. Columns contain Id and may include Header, SourceId, Partition, ForegroundColor, BackgroundColor, Alignment, and NrDecimals. Do not assume a particular table ID, column count, or column name unless your provider defines that contract for your report. For raw newRecords progress, cells retain their XML names, such as string, double, quantity, or measurement. Read record.__ordered when present; grouping by cell type would scramble column order. For quantities and measurements, the raw attributes are m (magnitude), u (unit), and e (measurement error). Convert values according to the report’s contract. Avoid converting large integers to JavaScript numbers if precision matters. Render labels and text as text. Decode objects according to an allowed content type rather than inserting arbitrary output as HTML.

Handle partial or failed results

  • Reject HTTP failures and Information Query responses with ok: false before consuming success data.
  • Wait for query completion, not just the first table or its Done flag.
  • Treat aborted queries, missing progress, and client deadlines as incomplete results.
  • Inspect helper HasErrors, Errors, and section messages before displaying a result as successful.
See Reports troubleshooting for the next check for each symptom.