API to Create Reports for Structured Datasource


1. Authentication

Obtain 'x-access-token'

Authenticate with the system to obtain an x-access-token. This token must be included in all client requests for server validation.

It can be obtained from this end-point.

Request URL

Method
URL

POST

auth/realms/master/protocol/openid-connect/token

Headers

Key
Values

Content-Type

application/x-www-form-urlencoded

Body (each key value in 'x-www-form-urlencoded' form)

Key
Values

grant_type

password

client_id

admin-cli

username

<username>

password

<password>


2. Get Datasource ID

Request URL

Method
URL

GET

api/datasources

Headers

Key
Values

x-access-token

string

This will fetch a list of all available data sources in the system. Copy the ID of the datasource for which the report is to be fetched.

3. Create new reports

Request URL

Method
URL

POST

/api/reports

Headers

Key
Values

x-access-token

string

Request

Key
Values

reportFormat

enum [CSV, JSON]

CSV -> Generate Report in CSV format

JSON -> Generate Report in JSON format

reportType

enum [TABLE_LIST, FILE_LIST, ENTITY-LIST, DSR_REQUEST_LIST]

TABLE_LIST -> For structured datasource, TABLE_LIST option is to be used to generate table view reports.

FILE LIST -> To generate file view report.

ENTITY-LIST -> To generate entity view reports.

DSR_REQUEST_LIST -> To generate a DSR ticket report.

parameters

list[objects]

[{

“key”: <string>,

“value”: <string>

},...]

Individual objects (Parameters -> objects) are defined below.

Parameters -> objects

key

enum [DATASOURCE_ID, CURSOR]

DATASOURCE_ID -> ID of the structured data source whose report needs to be generated.

CURSOR -> This is internal field used to pagination, since only full report generation is supported you need to pass this as empty (i.e “”)

values

string

Sample Request Body

{
  "reportFormat": "CSV",
  "reportType": "TABLE_LIST",
  "parameters": [
    {
      "key": "DATASOURCE_ID",
      "values": "640594b9b09f97ee2e49adeb"
    },
    {
      "key": "CURSOR",
      "values": ""
    }
  ]
}

Sample Response Body

[
   {
       "datasourceName": "mysql-demo",
       "databaseName": "automation_stuff",
       "instanceName": "<sample_id>",
       "tableName": "parent_table",
       "schemaName": "dbo",
       "columnName": "first_name",
       "attributeName": "FIRST_NAME",
       "attributeInstanceCount": 23,
       "attributeSensitivityLabel": "medium"
   },
      {
       "datasourceName": "mysql-demo",
       "databaseName": "automation_stuff",
       "instanceName": "<sample_id>",
       "tableName": "parent_table",
       "schemaName": "dbo",
       "columnName": "drivers_license_number",
       "attributeName": "US_DRIVER_LICENSE",
       "attributeInstanceCount": 11,
       "attributeSensitivityLabel": "high"
   }
]

Response Codes

Status
Response
Description

200

File will be downloaded.

Indicates a successful operation.

422

{"error":"Validation error."}

A validation error occurred.

401

{"error":"Unauthorized."}

The user is not authorized.

500

{"error":"Something went wrong. Please try again later."}

A server-side error occurred.


Postman Collection

Postman collection for Lightbeam APIs
Postman Environment for Lightbeam APIs

About LightBeam

LightBeam automates Privacy, Security, and AI Governance, so businesses can accelerate their growth in new markets. Leveraging generative AI, LightBeam has rapidly gained customers’ trust by pioneering a unique privacy-centric and automation-first approach to security. Unlike siloed solutions, LightBeam ties together sensitive data cataloging, control, and compliance across structured and unstructured data applications providing 360-visibility, redaction, self-service DSRs, and automated ROPA reporting ensuring ultimate protection against ransomware and accidental exposures while meeting data privacy obligations efficiently. LightBeam is on a mission to create a secure privacy-first world helping customers automate compliance against a patchwork of existing and emerging regulations.

For any questions or suggestions, please get in touch with us at: [email protected].

Last updated