Custom channels

Updated at:

Bot channels manage the various channels your organization uses for push notifications, simplifying communication. Quick BI lets you add custom push notification channels to send alerts and approval notifications. You can configure an external endpoint to receive messages. After you test the connection, Quick BI sends push messages to your configured endpoint. This topic describes how to configure a custom channel.

Create a custom channel

  1. Log on to the Quick BI console.

  2. On the Quick BI homepage, follow the instructions in the figure to open the custom channel creation page.

    image.png

  3. In the Create Custom Channel dialog box, configure the following parameters.

    image.png

    Parameter

    Description

    Name

    Enter a name for the custom channel.

    Endpoint address

    Enter the endpoint address to receive messages.

    The specified endpoint address must support POST requests.

    Secret key

    Enter the secret key for request signature verification.

    You can enter the key manually or click Automatically generate key to have Quick BI generate and populate a key for you.

    Your service must verify the signature of the received content. For more information, see Appendix: Receive and verify requests.

  4. Click Save and Test.

    After you save the channel, it appears in the bot channel list.image.png

Configure a custom channel for subscriptions

When you create a subscription, you can select the newly created custom channel as the alert method.

  1. On the Quick BI homepage, follow the instructions in the figure to go to the metric monitoring page.

    image

  2. When you create a subscription task, set Receiving Method to Custom Channel. The custom channel you created appears in the Receiving Channel list.

    image

    For more information, see Create a subscription task.

  3. The message payload for subscription notifications uses the following format:

    {
        "schema":"1.0",
        "header":{
            "organizationId":"b5fb3d10xx",  # The ID of the organization.
            "eventId":"bc679418-9e7xx",      # A unique event ID.
            "createTime":"1705398011696",
            "eventType":"SUBSCRIBE"  # The event type. Use this field to drive your business logic.
        },
        "event":{
            "createTime":"1705397830000",
            "customParams":"{\"param\":\"this is a test\"}",   # Custom parameters in the subscription, in JSON key-value format.
            "customReceiveGroups":"xxx",   # Custom recipient groups.
            "customReceiveUsers":[   # Custom recipients.
                {
                    "nick":"John Doe",     # Nickname.
                    "accountId":"cQUPAaY81L", # The third-party account ID saved in Quick BI.
                    "accountType":4,   # The account type.
                    "userId":"053da9"   # The Quick BI user ID.
                }
            ],
            "worksInfo":{              # Report information.
                "components":[        # Component information.
                    {
                        "componentId":"123", 
                        "componentName":"Crosstab",
                        "componentType":4
                    }
                ],
                "worksId":"0458e831-0250-486",   # The work ID.
                "worksName":"Leaderboard",             # The work name.
                "worksType":"PAGE",
                "workspaceName":"Resource Package Import",    # The workspace name.
                "workspaceId":"3e60ee7f-a99f-4231-913",   # The workspace ID.
                "worksUrl":"https://example.com/xxxx"       # The preview URL of the work.
     
            },
            "subscribeId":"73a1d0b2420",          # The subscription ID.
            "taskId": "4899407788885930938",      # The subscription task ID.
            "ownerId":"fec0741443204",            # The owner of the subscription task.
            "title":"Custom webhook push channel",        # The title of the subscription task.
            "subject":"Custom",                     # The subject of the subscription task.
            "content":{         # The text content of the subscription task.
                "head":"<p style=\";\">Custom webhook push channel</p>",   
                "tail":"<p style=\";\">Custom webhook push channel</p>"
            },
            "snapshot":{       
                "images":[           # Screenshot attachments.
                    {
                        "name":"2467699471858258259-1.jpeg",
                        "url":"https://qbi-dev.cn-shanghai.aliyuncs.com/xxxx"
                    }
                ],
                "pdfs":[            # PDF attachments.
                    {
                        "name":"2467699471858258259-1.pdf",
                        "url":"https://qbi-dev.cn-shanghai.aliyuncs.com/xxxx"
                    }
                ],
                "excels":[          # Excel attachments.
                    {
                        "name":"2467699471858258259-1.xlsx",
                        "url":"https://qbi-dev.cn-shanghai.aliyuncs.com/xxxx"
                    }
                ]
            }
        }
    }

Configure a custom channel for monitoring and alerts

When you monitor metrics, you can select the newly created custom channel as the alert method.

  1. On the Quick BI homepage, follow the instructions in the figure to go to the metric monitoring page.

    image.png

  2. In the Monitoring and Alerting Settings dialog box, set Alert Method to Custom Channel. Your newly created channel will then be available under Custom Channel.

    imageFor more information, see Configure monitoring and alerts.

  3. After you select a custom channel, you can specify Recipients. You can select multiple users or user groups.

    image

  4. The message payload for monitoring and alerts uses the following format:

    {
        "schema": "1.0",
        "header": {
            "eventId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
            "eventType": "MONITOR_ALARM",
            "createTime": "1721203200000",
            "organizationId": "org_xxxxx"
        },
        "event": {
            "monitorId": "xxxxx",
            "monitorName": "Daily Sales Monitoring",
            "owner": "user_xxxxx",
            "ownerName": "John Doe",
            "dashboardId": "dashboard_xxxxx",
            "dashboardName": "Business Analysis Dashboard",
            "reportUrl": "https://bi.example.com/dashboard/xxx",
            "checkTime": 1721203200000,
            "alarmItemCount": 2,
            "alarmItems": [
                {
                    "metricName": "Sales Amount",
                    "value1": "15234.50",
                    "value2": "12000.00",
                    "reason": "Current value (15234.50) increased by 26.95% compared to the same period yesterday (12000.00), exceeding the 20% threshold.",
                    "dimValueMap": {
                        "region": "East China",
                        "category": "Electronics"
                    }
                },
                {
                    "metricName": "Sales Amount",
                    "value1": "9800.00",
                    "value2": "7500.00",
                    "reason": "Current value (9800.00) increased by 30.67% compared to the same period yesterday (7500.00), exceeding the 20% threshold.",
                    "dimValueMap": {
                        "region": "South China",
                        "category": "Apparel"
                    }
                }
            ],
            "customReceiveUsers": [
                {
                    "userId": "user_001",
                    "nick": "Jane Smith",
                    "accountId": "dingtalk_xxxxx",
                    "accountType": 1
                },
                {
                    "userId": "user_002",
                    "nick": "Peter Jones",
                    "accountId": "wechat_xxxxx",
                    "accountType": 2
                }
            ]
        }
    }

Configure a custom channel for data entry tasks

  1. When you configure a data entry task, select Custom Channel for the Send Data Entry Task setting.image

  2. The message payload for a data entry task notification uses the following format:

    {
     "deadlineTime": "2024-07-26 20:00:00", # The deadline for data entry.
     "taskUrl": "https://bi.aliyun.com/xxx", # The URL for the data entry form.
     "taskTitle": "Data Entry Task Name", # The name of the data entry task.
     "sendTime": "2024-07-04 19:19:20", # The time the data entry task was sent.
     "dashboardName": "Peter Jones's Data Entry" # The name of the report.
    }

Configure a custom channel for external approvals

Organization administrators can select a newly created custom channel as an external approval channel.

  1. On the Configuration Management page, follow the instructions in the following figure to create a new custom channel.image.png

  2. On the Collaboration Configuration page, follow the instructions in the following figure to enable the custom approval channel.

    image.png

    After you enable this setting, when a user requests permissions for Quick BI resources, the custom channel also receives the request notification.

  3. The message payload for approval notifications uses the following format:

    {
        "authPointsValue":3,    # Permission point.
        "resourceId":"b8b5392b-bb44-4bd8-e9642787e8d",   # The ID of the resource for which permissions are requested.
        "resourceName":"20 components on first screen (8 for mobile)",     # The name of the report resource.
        "approverId":"e52b777a1dde4bfb94f91e18128bcfb0",  # The approver's UID.
        "roleId":0,
        "applyReason":"123123",              # The reason for the application.
        "extInfo": [                         # Extended information. When the resource type is data entry to storage, this field shows the name, type, and submitted information for each control in the form.
          {
              "data": {                     # The submitted data for the controls.
                "63912418-e311-4573-84be-1f732ffd9f35": 20,   # The control ID and its submitted value.
                "f9a46753-98a1-4709-9327-949c6a03af08": "Test",
                "ffe8327a-9de8-4699-a23a-097088a22d2e": "Test1"
              },
              "dataId": null,               # The data record ID.
              "dataWithComponent": {        # Detailed information about the controls.
                "63912418-e311-4573-84be-1f732ffd9f35": {   # The control ID.
                "componentType": "number",  # The control type.
                "data": 20,                 # The value submitted by the user for this control.
                "label": "Age"              # The control name.
              },
                "f9a46753-98a1-4709-9327-949c6a03af08": {
                "componentType": "text",
                "data": "Test",
                "label": "Notes"
              },
                "ffe8327a-9de8-4699-a23a-097088a22d2e": {
                "componentType": "text",
                "data": "Test1",
                "label": "Name"
              }
            }
          }
        ],
        "resources": [                       # Menu information. This field exists only for data portal approvals.
          {
              "resourceId": "a8d78c04-df99-42c3-a0a2-dbe7350b077c",  # The menu ID.
              "resourceName": "Level-3 menu",     # The menu name.
              "resourceType": "0"            # The menu type.
          }
        ],
        "applicantName":"Mr. Zhang",                 # The applicant's nickname.
        "gmtCreate":1705399339000,               # The creation time.
        "approverName":"Ms. Wang",                  # The approver's nickname.
        "expireDate":1708077734000,              # The expiration date of the permission.
        "workspaceName":"Quick BI Evaluation Workspace",        # The workspace name.
        "applicantId":"e9a40c524ef8471faefbd",   # The applicant's UID.
        "applicationId":"b31c8cf5-aa31-42f7-927a-da3cb2feefd4",  # The approval ID.
        "resourceType":"dashboard"               # The resource type.
    }

    Note 1: The resources field, which contains menu information, exists only for data portal approvals.

    The resourceType in resources supports the following values:

    • 0: dashboard

    • 2: spreadsheet

    • 5: data entry

    • 6: ad-hoc query

    • 7: ad-hoc analysis

    • 8: data screen

    Note 2: Resource type mapping (case-insensitive)

    • dataProduct: data portal

    • portal_menu: data portal menu

    • dashboard: dashboard

    • screen: data screen

    • report: spreadsheet

    • ANALYSIS: ad-hoc analysis

    • dashboardOfflineQuery: ad-hoc query

    • dataForm: data entry

    • datasource: data source

    • dataFormInsertData: data entry to storage

    • dataFormInsertData: data entry to storage

    Note 3: The authPointsValue permission points for each resource are as follows:

    Resource type

    authPointsValue permission point description

    Data entry

    • 1: Submit data

    • 9: Manage own data

    • 10: Manage all data

    • 11: Edit

    Dataset, data source, data preparation

    • 1: Use

    • 11: Edit

    Data screen, spreadsheet, dashboard, ad-hoc query

    • 1: View only

    • 2: Export

    • 3: View and export

    • 11: Edit

    Data portal

    • Data portal permissions

      • 11: Edit

    • Menu content permissions

      • Same as above

      • Important

        Special case: For data entry, the value for 'Manage own data' is 3.

Appendix: Receiving and verifying signatures in an external system

Quick BI pushes content using the POST method and includes the following information in the request. After your system receives the content, verify the signature by comparing the sign value as needed.

  • Request header:

    X-TaskId: The task ID. Use this ID to uniquely identify a task request. This lets you check for duplicates or provide the ID to Quick BI support for troubleshooting.

  • Request parameters:

    • timestamp: The timestamp.

    • nonce: The nonce.

    • sign: The signature.

These request parameters are for security. They help prevent replay and tampering attacks. The signature is generated as follows:

sign = SHA256.digest(timestamp + nonce + token)
Note
  1. The value of token is the Request Add Key generated during creation. The receiving service must verify that the generated sign matches the expected value.

  2. Webhooks have a 30 s timeout. Process messages asynchronously after your webhook endpoint receives them. This prevents message retries or failures. Quick BI has no specific requirements for the response body from the webhook endpoint. Simply return an HTTP status code of 200 and any non-empty text to acknowledge receipt.