BI Bookmark Data

Shieldware, Inc. is a parent company with several subsidiaries and therefore has several client accounts with Cleverbridge. They use Business Intelligence (BI) as their reporting tool. Their development department fetches one or more bookmarked reports from multiple client accounts in (BI), combining them into one large report file. Shieldware's development team implemented the report visualization option using the GraphQL API.

You can use the GraphQL API for reporting purposes in the following way:

Fetch BI Bookmark Data for One Report

The biBookmark query object retrieves the report data for a bookmarked report in Business Intelligence (BI) that pertains to a particular user. This allows you to integrate the report with your internal systems or build a custom front-end application that displays live data from the bookmarked report. You can define the time frame of the requested bookmarked report, including the granularity (hours, days, months, years). You must provide a bookmarkId in the biBookmark argument.

Example Request

query {
  biBookmark(bookmarkId: 99149, isDefaultBookmark: false) {
    name
    id
    biReport(
      absoluteDateTimeFilter: {
        startDate: "2019-05-28T15:29:05Z"
        endDate: "2020-05-28T15:29:05+00:00"
        groupingLevel: MONTH
      }
    ) {
      biChartSettings {
        currencyId
        galleryType
        pointLabels
        showZero
      }
      measures {
        format
        title
      }
      result {
        measureResults {
          measureIndex
          measureTitle
        }
        xAxisLabels
      }
    }
  }
}

The API call returns the biBookmark object with the requested fields.

Example Response

{
  "data": {
    "biBookmark": {
      "name": "Top 10 Products",
      "id": 99149,
      "biReport": {
        "biChartSettings": {
          "currencyId": "EUR",
          "galleryType": "BAR",
          "pointLabels": false,
          "showZero": true
        },
        "measures": [
          {
            "format": "Currency",
            "title": "Sales revenue (client), Paid (aggregated)"
          },
          {
            "format": "Numeric",
            "title": "Number of orders, Paid (aggregated)"
          },
          {
            "format": "Numeric",
            "title": "Number of sessions, Paid (aggregated)"
          }
        ],
        "result": {
          "measureResults": [
            {
              "measureIndex": 0,
              "measureTitle": "Sales revenue (client), Paid (aggregated)"
            },
            {
              "measureIndex": 1,
              "measureTitle": "Number of orders, Paid (aggregated)"
            },
            {
              "measureIndex": 2,
              "measureTitle": "Number of sessions, Paid (aggregated)"
            }
          ],
          "xAxisLabels": [
            "Germany (DE)",
            "United States (US)"
          ]
        }
      }
    }
  }
}

Fetch BI Bookmark Data for All Reports

The biBookmarksquery object retrieves the report data for multiple bookmarked reports in Business Intelligence (BI) that pertain to a particular user. This allows you to integrate the reports with your internal systems or build a custom front-end application that displays live data from the bookmarked report. You can define the time frame of the requested bookmarked report, including the granularity (hours, days, months, years). You can use the value of bookmarkTypeIds to limit the request to the Default, Personal, or Account bookmarks for the user.

Example Request

query {
  biBookmarks(allowAccountSubsets: true, bookmarkTypeIds: [PERSONAL, ACCOUNT]) {
    id
    name
    relatedClients {
      fullName
      id
      shortName
      defaultBaseCurrency {
        name
        symbol
        id
      }
      defaultBaseLanguage {
        name
        id
        isoCode
      }
    }
  }
}

The API call returns the biBookmarks object with the requested fields.

Example Response

{
  "data": {
    "biBookmarks": [
      {
        "id": 99156,
        "name": "Test orders",
        "relatedClients": [
          {
            "fullName": "CORE-10981",
            "id": 1675,
            "shortName": "CORE-10981",
            "defaultBaseCurrency": {
              "name": "Euro",
              "symbol": "€",
              "id": "EUR"
            },
            "defaultBaseLanguage": {
              "name": "English",
              "id": "EN",
              "isoCode": "en"
            }
          }
        ]
      },
      {
        "id": 99149,
        "name": "Top 10 Products",
        "relatedClients": [
          {
            "fullName": "CORE-10981",
            "id": 1675,
            "shortName": "CORE-10981",
            "defaultBaseCurrency": {
              "name": "Euro",
              "symbol": "€",
              "id": "EUR"
            },
            "defaultBaseLanguage": {
              "name": "English",
              "id": "EN",
              "isoCode": "en"
            }
          }
        ]
      }
    ]
  }
}

Update BI Bookmark Data

The updatebiBookmark mutation object adds tags to one or more of your bookmarked reports in the Business Intelligence (BI). You can assign tags to your reports and filter the reports based on these tags.

Example Request

mutation {
  updateBiBookmark(input: { bookmarkId: 99149 }) {
    biBookmark {
      biReport(
        absoluteDateTimeFilter: {
          startDate: "2019-05-28T15:29:05Z"
          endDate: "2020-05-28T15:29:05+00:00"
          groupingLevel: MONTH
        }
      ) {
        biChartSettings {
          currencyId
          galleryType
        }
        result {
          measureResults {
            measureIndex
            measureTitle
          }
          xAxisLabels
          yAxisGroups
        }
      }
    }
  }
}

The API call returns the updatebiBookmark mutation object with the requested fields.

Example Response

{
  "data": {
    "updateBiBookmark": {
      "biBookmark": {
        "biReport": {
          "biChartSettings": {
            "currencyId": "EUR",
            "galleryType": "BAR"
          },
          "measures": [
            {
              "format": "Currency",
              "title": "Sales revenue (client), Paid (aggregated)"
            },
            {
              "format": "Numeric",
              "title": "Number of orders, Paid (aggregated)"
            },
            {
              "format": "Numeric",
              "title": "Number of sessions, Paid (aggregated)"
            }
          ],
          "result": {
            "measureResults": [
              {
                "measureIndex": 0,
                "measureTitle": "Sales revenue (client), Paid (aggregated)"
              },
              {
                "measureIndex": 1,
                "measureTitle": "Number of orders, Paid (aggregated)"
              },
              {
                "measureIndex": 2,
                "measureTitle": "Number of sessions, Paid (aggregated)"
              }
            ],
            "xAxisLabels": [
              "Germany (DE)",
              "United States (US)"
            ],
            "yAxisGroups": [
              "226041",
              "226145"
            ]
          }
        }
      }
    }
  }
}