Doc Biwee
English
English
  • Presentation of Biwee
  • Get Started
    • Install Biwee
    • Video : My first steps with Biwee
  • Create dashboard
    • Add a visual component
      • Chart
      • Pie
      • Cards
      • Treemap
      • Text Box
      • Pivot Grid
      • Tabs
      • Scatter Chart
      • Gauge
      • Images
      • Grid
      • Range Filter
      • Filter Elements
      • Geo Points Map
      • Choropleth Map
      • Groups
    • Right-click on a component
    • Export a visual component
    • Maximize a visual component
    • Interactivity of a component
    • Data filters in components
    • Dashboard parameters
    • Conditionnal formatting
    • Interactions between dashboard
  • API Integration
  • Data Analyse
    • Performing calculations on data
    • Configure a calculated field
    • Directory of functions
    • Configure calcul in a visual component
    • Aggregate function
      • Aggregations at an intermediate level
      • Usage examples and use cases for the aggr() function
    • Window calculation
  • Settings
    • My account
    • User groups
    • Agent
    • Company settings
    • Options
    • About Biwee
  • Data connection
    • Introduction
    • Database connectors
    • Social network connectors
    • Emailing connectors
    • Files connectors
    • Other connectors
  • Sharing in Biwee
  • Creation of queries
    • Queries on databases
    • SQL Querie parameters
  • Back office biwee
    • User management
  • Changelog
    • Version 3.3
Propulsé par GitBook
Sur cette page
  • Introduction
  • Display format
  • A simple example
  • Detail of available API methods
  • GetToken
  • GetToken
  • Changing the connection string and adding additional logs
  • GetDashboard
  • GetToken

Cet article vous a-t-il été utile ?

API Integration

PrécédentInteractions between dashboardSuivantPerforming calculations on data

Dernière mise à jour il y a 3 ans

Cet article vous a-t-il été utile ?

Introduction

The dashboards prepared in the Biwee can be integrated within another application. The Biwee Integration API takes care of the mechanism and communication between Biwee and your application.

Display format

For the integration, the dashboards are rendered in HTML format and embedded via an iframe tag. It is then possible to embed them in a website, a web application or a classic application.

A simple example

This example presents the integration of a dashboard within a php application.

1. I create a dashboard in Biwee.

2. After saving it, in the "Share" menu, I check the box "Accessible in API", the API code is no longer grayed out.

3. The specific integration code for this dashboard is presented to me:

4. I copy / paste the php code within my site:

<?php
session_start();
?>

<html>
    <head><title>My php application</title></head>
    <body>
        <h1>My php application</h1>
        <h2>I just integrated a dashboard:</h2>
        <div  style="width:900px; height:800px;">

        <?php
        // ------- Zone to customize :
        $sessionId = session_id() or 'xxxx'; // Replace  xxxx with the session Id or the user Id.
        // -------  End of zone to customize.

        $tokenGUID = file_get_contents('https://www.biwee.fr/Api/GetToken/MyAPIKey/'. $sessionId .'/MyGUID');
        $tokenGUID = substr($tokenGUID, 1, -1);
        ?>

                <iframe src="https://www.biwee.fr/Tdb/<?php echo $tokenGUID; ?>" scrolling="no" style="width:100%; height:100%; border:none;">
                </iframe>
         </div>
    </body>
</html>

In this example, I use as session id the one of the php session returned by session_id(). The session id will be used when the user logs out of my application. The same session id must be used for the display of the dashboard and for the closing of the session.

To access the Biwee API, an API key is required. This key is personal and secret and is your login. The code generated by Biwee automatically includes the API key associated to your account. Be careful not to disclose your key

5. I add in my application the logout code prepared by Biwee. This code ensures that when a user of my application logs out, they can no longer access the dashboards.

<?php
// ------- Zone to customize :
$sessionId = session_id() or 'xxxx'; // Replace  xxxx with the session Id or Id of the user to disconnect.
// -------  End of zone to customize.

file_get_contents('https://www.biwee.fr/Api/Logout//'. $sessionId);
?>

Result:

Detail of available API methods

GetToken

GET https://www.biwee.fr/Api/GetToken

Retrieve a dashboard opening token.

Path Parameters

Name
Type
Description

apiKey

String

Your API Key

sessionID

String

ID that can be used to invalidate the token

dashboardGuid

String

Identifier of the dashboard

SQLparameters

String

Possible SQL parameters (Param1=Value1;Param2=Value2)

'3e74dee5-8000-4973-b4a1-e37bda5c1dbc' // example

GetToken

POST https://www.biwee.fr/Api/GetToken

Retrieve a token by being able to replace the connection string.

Path Parameters

Name
Type
Description

apiKey

String

Your API Key

sessionID

String

ID that can be used to invalidate the token

dashboardGuid

String

Identifier of the dashboard

SQLparameters

String

Possible SQL parameters (Param1=Value1;Param2=Value2)

Headers

Name
Type
Description

Content-Length

String

Content size

Content-Type

String

text/plain

Request Body

Name
Type
Description

Content

String

Connection chain that the connector should use

{
    // Response
}

Changing the connection string and adding additional logs

It is possible when calling the API to specify additional elements by sending a serialized JSON object.

This object can contain the following fields:

  • connectionString

  • user

  • organization

  • customInfo

The "connectionString" field allows you to specify a connection string and therefore to make the dashboard retrieve data from a different location than the one configured in the software.

The "user", "organization", and "customInfo" fields allow additional data to be added to our database for statistical analysis purposes.

This example presents the integration of a dashboard within a php application. This dashboard uses data from a database with a replaced connection string.

Example using part of the code generated from the software:

<?php
                // ------- Zone to customize:
                $sessionId = session_id(); // Replace the xxxx with the session id or user id.
                // ------- End of zone to customize.
// Replace with the desired values 
$postData = json_encode(array(
	'connectionString' => 'Connection string',
	'user' => 'My user',
	'organization' => 'My company',
	'customInfo' => 'A piece of information'
);

$opts = array('http' =>
    array(
        'method' => 'POST',
        'header' => 'Content-Type: application/json',
        'content' => $postData
    )
);

$context = stream_context_create($opts); 
$tokenGUID = file_get_contents('https://www.biwee.fr/Api/GetToken/ MyAPIKey /'. $sessionId .'/MyGUID', false, $context);
        $tokenGUID = substr($tokenGUID, 1, -1);
?>

GetDashboard

GET https://www.biwee.fr/Tdb

Allows to display a dashboard. Can be used as a URL in a browser or in an iframe. By default the background of the page containing the dashboard is white. It is however possible to specify another color.

Path Parameters

Name
Type
Description

token

String

Dashboard opening token

Query Parameters

Name
Type
Description

color

String

Color of the dashboard texts

ex : cyan , $7FFF00

background-color

String

Color of the dashboard texts

ex : cyan , $7FFF00

{
    // Response
}

GetToken

POST https://www.biwee.fr/Api/GetToken

Retrieve a token by being able to replace the connection string with additional logs.

Path Parameters

Name
Type
Description

apiKey

String

Your API Key

sessionID

String

ID that can be used to invalidate the token

dashboardGuid

String

Identifier of the dashboard

SQLparameters

String

Possible SQL parameters (Param1=Value1;Param2=Value2)

Headers

Name
Type
Description

Content-Length

String

Content size

Content-Type

String

application/json

Request Body

Name
Type
Description

Content

object

JSON object that can contain the following fields:

- Connection String

- User

- Organization

- CustomInfo

(Allows for additional data to be added to our database for statistical analysis purposes)

{
    // Response
}

Example of embedding in an iframe with background color change:

<iframe src="https://www.biwee.fr/Tdb/<?php echo $tokenGUID; ?>background-color=blue" scrolling="no" style="width:100%; height:100%; border:none;">
</iframe>

Usable colors are all named colors defined in the HTML and CSS specifications, as well as colors described according to hexadecimal notation.

Warning: when using hexadecimal notation, the usual # must be replaced with a $.

⚠️