Exago .NET API Documentation
GetApiKey Method
Example 
WebReports.Api Namespace > Api Class : GetApiKey Method

Returns the Api Key for use with the JavaScript API. This method is used instead of the GetUrlParamString Method for returning the session identifier to the client when embedding Exago BI components into divs instead of iframes.

See JavaScript API for more information.

Syntax
public System.string GetApiKey()

Return Value

The Api Key portion of the URL for use with the JavaScript Api
Exceptions
ExceptionDescription
Preloading report SQL is only possible when the ApiAction is to create a new Advanced Report or ExpressView.
Example
Call GetApiKey() after all session variables have been set. Send the returned Api Key string to the client web page in order to load the JavaScript API.
using WebReports.Api;

public class Example
{
    string appPath = "http://localhost/exago/";
    string configFn = "WebReports.xml";
    string reportName = "Example Reports\\Client Report";

    public static void Main()
    {
        // Instantiate the Api object
        Api api = new Api(appPath, configFn);

        // Load a report for execution
        api.ReportObjectFactory.SaveToApi(api.ReportObjectFactory.LoadFromRepository(reportName));

        // Get the ApiKey for loading the JavaScript Api object
        string apiKey = api.GetApiKey();
        
        // Send the ApiKey to the client web page
        /* implementations will vary */
    }
}
See Also

Reference

Api Class
Api Members

Exago Knowledge Base

JavaScript API