sch-quickbi-processing-sapi
home
schm-quickbi-processing-sapi
Interface description: Interface for embedded presentation of QuickBI reports. There are two steps. The first step interface generates a temporary ticket to display the QuickBI report, and the second uses the ticket generated in the first step to display the contents of the QuickBI report.
UAT_URL: https://schm-api-test.shiseido.cn/schm-quickbi-processing-sapi
PROD_URL: https://schm-api.shiseido.cn/schm-quickbi-processing-sapi
Header description
For access interfaces, set key to client_id and client_secret in the header. The authentication information may vary according to personnel or organizations. You need to apply for the authentication information from the administrator.
client_id: fa98****3452
client_secret: 108b****41f2
API Description:
Generate Access Ticket
Interface Request: /work/generate
Interface Description: Generate a one-time temporary access ticket to a report with a user's perspective and privileges. This ticket can be used once by default and expires after 240 minutes.
Request method: HTTP POST
Request Body Description:
Field Description | Field Name | Required | Type |
---|---|---|---|
The user's account number. | account | Y | String |
The Report(work or page) ID | worksId | Y | String |
Parameter example
{
"account": "kun.li",
"worksId": "6d2b7d0e-816a-4701-bab3-1b6ec299c19e"
}
Response Body Description:
Field Description | Field Name | Type |
---|---|---|
The generated ticket used to present the report | accessTicket | String |
Request success identifier. | success | Boolean |
Response example
{
"result": {
"accessTicket": "a44a73ae-028e-4901-8ef4-ccca3c8ae356"
},
"success": true
}
View Report
Interface Request: /work/view
Interface Description: Use the generated Ticket to access the report content.
Request method: HTTP GET
Query Param Description:
Field Description | Field Name | Required | Type |
---|---|---|---|
The interface "generate" generates an accessTicket. | accessTicket | Y | String |
The Report(work or page) ID | worksId | Y | String |
Parameter example
https://schm-api.shiseido.cn/schm-quickbi-processing-sapi/work/view?accessTicket=cb8b2649-364b-415b-a9a4-2f2de10dfab2&worksId=6d2b7d0e-816a-4701-bab3-1b6ec299c19e
Response Body example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
</head>
<body style="height:100vh;">
<iframe
class="quickbi-iframe-demo"
src=#[payload]
scrolling="no"
frameborder="0"
width="100%"
height="600" style="height:100vh;">
</iframe>
<script>
const quickBIURL = ['https://bi.aliyuncs.com'];
function messageListener(event) {
if (quickBIURL.includes(event.origin)) {
console.log('Quick BI Dashboard Height:', event.data.height);
console.log('Quick BI Dashboard Id:', event.data.pageId);
}
}
window.addEventListener('message', messageListener);
const iframe = document.querySelector('iframe');
iframe.contentWindow.postMessage({getDashboardHeight: true}, '*');
</script>
</body>
</html>