Articles in this section

How to utilize the embed token in the Embedded reporting

Published:
Updated:

Bold Reports provides REST APIs that allow programmatic access and management of various reporting resources. These APIs enable developers to automate tasks and integrate report functionalities within applications.

To efficiently generate an embed token from the Bold Reports API, you can use Postman, a popular API client. This guide outlines the steps to retrieve report details based on a specific category name.

Steps to Generate the Embed Token

  1. Open the Postman application and create a new POST HTTP request.

  2. Follow the instructions to generate an embed token for the Bold Reports Server using the API.

  3. The request URL should follow this format, where you need to replace placeholders with actual values:

    image.png

    {BoldReportsUrl}/reporting/api/site/{{tenant-name}}/token
    

Note: Replace {BoldReportsUrl} with the base URL of your Bold Reports server, <tenant-name> with your actual tenant name.

  1. The request body should include the following mandatory fields: grant_type, ReportServerUser, and Password. Additionally, you can configure custom attributes and report parameters for the report by adding them in the request body.
     {
    "grant_type": "embed_token",
    "ReportServerUser": "string",
    "Password": "string",
    "ExpiresIn": "123",
      "ReportParameters": [{
            "Key": "string",
            "Values": [
                "string1",
                "string2"
            ]
        }
    ],
    "CustomAttributes": [
        {
            "Key": "string",
            "Value": "string"
        },
        {
            "Key": "string",
            "Value": "string"
        }
    ]
    }
  1. You will receive a response containing the embed token under the access_token tag:
    image.png

Using the token in Bold Reports Viewer

After generating the token with the customized parameter and custom attributes, you can use it to run the report with the respective parameters and custom attributes within the embedded application. Kindly add the embed token to the following API when initializing the viewer.

$("#report-viewer").boldReportViewer({
        reportServiceUrl: "http://reportserver.syncfusion.com/ReportService/api/Viewer",
        reportPath: report_path,
        embedToken: generated_access_token
}); 
Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied