InetSoft API Client
This library provides a client for the InetSoft web API.
Installation
$ npm install @inetsoft/api-client
By default, the library uses the Fetch API for communicating with the web service. If you require compatibility with older browsers, you will need to include a Fetch polyfill, such as this one. If you are using the client from Node.js, you will need to add the node-fetch package to your project.
Alternatively, you can implement HttpAdapter
and use any HTTP client implementation
you want. You can then pass an instance of your adapter to the createApiClient()
call.
Usage
You create an instance of the API client by calling the createApiClient()
function,
as shown below.
var client = createApiClient('http://localhost:8080/sree', 'apiAccount', 'password');
client.report.getReports().then(addReports);
function addReports(reports) {
// do something with the reports
}
Note that when using in a web page, the page must be served from the same domain as the InetSoft application or you must add the appropriate CORS HTTP headers.
Using in TypeScript is similar, as shown in the following example.
import { createApiClient } from '@inetsoft/api-client';
const client = crateApiClient('http://localhost:8080/sree', 'apiAccount', 'password');
client.report.getReports().then(reports => {
reports.forEach(report => {
// do something with the report
});
});
Further information on the client APIs can be found in the API documentation.
Version Compatibility
The following table lists the compatibility between versions of this library and the InetSoft product version.
API Version | Product Version |
---|---|
1.0.0 | 2019 |
License
The InetSoft JavaScript API Client library is licensed under the Apache License 2.0.