How to embed Yurbi content within your application
Below is a help desk article explaining how to seamlessly embed Yurbi content (dashboards or reports) into your own application. It also explains how to automatically log a user into Yurbi via a session token.
1. Overview
Yurbi supports seamless login and embedding through a session token system. In essence, you:
- Generate a session token by calling the Yurbi API.
- Use that token to embed specific dashboards or reports.
- Optionally redirect users directly to Yurbi interfaces (dashboard, library, or builder) without needing a separate login.
2. Generating a Session Token
To seamlessly log a user in, you must first obtain a session token. This is done via the /api/Login/DoLogin
endpoint:
POST https://{{domain}}/api/Login/DoLogin
Example Request Body
{
"bolForceLogin": true,
"isGuest": false,
"UserId": "{{user}}",
"UserPassword": "{{password}}"
}
Sample Response Highlight
{
"ErrorCode": 0,
"ErrorMessage": "",
"LoginSession": {
"ErrorCode": 0,
"ErrorMessage": "",
"SessionToken": "LVPACMJFBMZKUHRIXMQSTUZUY",
"SessionFlag": 0,
"isGuestSession": false,
"SessionTimeLeft": 0,
"SessionExpir": "2025-04-02T12:26:03.3316261+00:00",
...
},
"LoginUser": { ... }
}
Note: The SessionToken
in the response is the key part—this is what you’ll use to embed content or seamlessly log in.
Session Token Expiration and Invalidations
- Expiration: The token expires based on the
SessionExpir
field returned in the response. - Invalidation: If a user from another location attempts to use the same token, it will invalidate the existing session.
To check if a session token is still valid, call:
POST /api/Session/CheckSession
To extend a token without a full re-login, call:
POST /api/Session/RefreshSession
3. Embedding Dashboards or Reports
Once you have a valid session token, you can append it to an embed URL:
Dashboard URL
https://{url}/embed.html?t=d&i={dashboardId}&s={sessionToken}
Report URL
https://{url}/embed.html?t=r&i={reportId}&s={sessionToken}
Either URL can be placed in an <iframe>
on your website or used as a direct link.
4. Finding Dashboard and Report IDs
Dashboard ID: Edit the dashboard in Yurbi, and look to the top-right of the edit sidebar.
(display image)
Report ID: Edit the report and look to the top-right of the edit sidebar.
(display image)
When you enable embed on a report or dashboard, Yurbi automatically generates a menu item in the Library with copy-ready links.
(display image)
5. Adding Prompt Parameters to an Embedded Report
If your report supports user prompts or parameters, you can create an embed link with those parameters included. This is often done via the “Embed Library” in Yurbi, which helps you construct the URL.
(display image)
Below is an example URL including prompt parameters:
https://{url}/embed.html?t=r&i=1739550061&isprompt=true&prmpt0low=11000&prmpt0skipped=false&prmpt0like=false&prmpt0betweenfalse&prmpt1low=50&prmpt1skipped=false&prmpt1like=false&prmpt1betweenfalse&prmpt2skipped=true&prmpt2like=false&prmpt2betweentrue&s={sessionToken}
Using this link within an <iframe>
in your application provides a seamless, parameterized reporting experience.
6. Seamlessly Logging Into Yurbi
Besides embedding individual reports or dashboards, you can use the session token to log users directly into the Yurbi interface:
-
Dashboard Section
https://{url}/sso.html?s={sessionToken}
-
Library Section
https://{url}/sso.html?s={sessionToken}&h=1
-
Builder Section
https://{url}/sso.html?s={sessionToken}&h=2
When a user navigates to one of these links with a valid token, they’ll be automatically signed into Yurbi with the appropriate view.
Summary
- Obtain a token with
/api/Login/DoLogin
. - Use the token to embed dashboards or reports.
- Optionally pass prompt parameters for advanced reporting.
- Leverage the token to grant seamless access to the Yurbi interface (dashboard/library/builder).
This process ensures your users have a streamlined experience, avoiding extra logins and presenting embedded analytics exactly where you need them.