tencent cloud

CreateEmbedToken
Last updated: 2025-11-13 21:02:42
CreateEmbedToken
Last updated: 2025-11-13 21:02:42

1. API Description

Domain name for API request: bi.intl.tencentcloudapi.com.

This API is used to create an embedded report with strong authentication.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: CreateEmbedToken.
Version Yes String Common Params. The value used for this API: 2022-01-05.
Region No String Common Params. This parameter is not required.
ProjectId No Integer Shares the project ID.
PageId No Integer Shares the page ID. This field is empty (0) for embedding a dashboard and is not passed for embedding ChatBI.
Intention No String "embed" indicates page dashboard embedding, and "chatBIEmbed" indicates ChatBI embedding.
Scope No String "page" indicates embedding a page, "panel" indicates embedding the entire dashboard, and "project" is used for ChatBI embedding.
ExpireTime No String Expiration time. Unit: minutes. Maximum value: 240 (namely, 4 hours). Default value: 240.
ExtraParam No String Alternate field.
UserCorpId No String User enterprise ID (only used for multi-user).
UserId No String User ID (only used for multi-user).
TicketNum No Integer Access count limit (range: 1-99999). Leave empty to disable access restrictions.
GlobalParam No String Global filter parameters: Applies to all report filter criteria. Should be formatted as a JSON string.
** Currently, only character-type page parameters can be bound to global parameters.
**
[
{
"ParamKey": "name", page parameter name.
"JoinType": "AND", // connection method. Currently, only AND is supported.
"WhereList": [
{
"Operator": "-neq", // operator. Refer to the following instructions.
"Value": [ action value. For a single-value array, only one value is passed.
"zZWJMD",
"ZzVGHX",
"Hunan province".
"Hebei province".
]
}
]
},
{
"ParamKey": "genderParam",
"JoinType": "AND",
"WhereList": [
{
"Operator": "-neq",
"Value": [
"Male".
]
}
]
}
]



Currently supported operators.
-neq not equal to != operator.
-eq equal to = operator.
-is in operator.
TokenType No Integer 100: no user bound. Create 1 token at a time. UserCorpId and UserId are optional. ChatBI embedding is not supported.
200: single token per user. Create 1 token at a time. UserCorpId and UserId required.
300: multiple tokens per user. Create multiple tokens at a time. UserCorpId and UserId required.
TokenNum No Integer The number of tokens created at one time.
ConfigParam No String Embedded display configurations: Currently for ChatBI embedding scenarios; TableFilter represents data table list filtering, SqlView represents SQL view feature.

3. Output Parameters

Parameter Name Type Description
ErrorInfo ErrorInfo Custom error information object.
Note: This field may return null, indicating that no valid values can be obtained.
Extra String Additional information.
Note: This field may return null, indicating that no valid values can be obtained.
Data EmbedTokenInfo Data.
Note: This field may return null, indicating that no valid values can be obtained.
Msg String Result description.
Note: This field may return null, indicating that no valid values can be obtained.
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Creating a Token for Report Embedding - Strong Authentication

This example shows you how to create a token for report embedding.

Input Example

POST / HTTP/1.1
Host: bi.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateEmbedToken
<Common request parameters>

{
    "ProjectId": 1982493789748932,
    "PageId": 1982493789748932,
    "Intention": "Intention",
    "Scope": "Scope",
    "ExpireTime": "ExpireTime",
    "ExtraParam": "ExtraParam",
    "UserCorpId": "UserCorpId",
    "UserId": "UserId",
    "TicketNum": 1982493789748932,
    "GlobalParam": "GlobalParam",
    "TokenType": 1982493789748932,
    "TokenNum": 1982493789748932
}

Output Example

{
    "Response": {
        "Msg": "success",
        "RequestId": "adfacf71-c59c-4569-897d-955a1e41ee89",
        "Extra": "",
        "Data": {
            "Id": 11,
            "ProjectId": "1",
            "PageId": null,
            "ExtraParam": "",
            "Scope": "panel",
            "ExpireTime": 10,
            "CreatedUser": null,
            "CreatedAt": "2022-04-28 14:26:01",
            "UpdatedUser": null,
            "UpdatedAt": "2022-04-28 14:26:01",
            "BIToken": "300cf2a4-cfb8-47b8-9bc0-4a1f1f74bc1d",
            "UserCorpId": "",
            "UserId": "",
            "TicketNum": 0,
            "GlobalParam": "[{\"ParamKey\": \"province\",         \"JoinType\": \"and\",         \"WhereList\": [             {                 \"Operator\": \"-is\",                 \"Value\": [                     \"Chongqing City\",                     \"Hubei Province\",                     \"Hunan Province\",                     \"Sichuan Province\"             ]             }         ]     } ]"
        }
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
AuthFailure CAM signature/authentication error.
FailedOperation Operation failed.
InternalError Internal error.
InternalError.Internal Internal error.
InvalidParameter Parameter error.
InvalidParameter.Embed Report embedding error.
InvalidParameterValue Parameter value error.
MissingParameter Parameters are missing.
MissingParameter.MissingParam The required parameter is missing.
OperationDenied Operation denied.
RequestLimitExceeded Too many and frequent requests.
UnauthorizedOperation Unauthorized operation.
UnauthorizedOperation.Authorize Permission error.
UnauthorizedOperation.UserNotExist The user does not exist.
UnknownParameter Unknown parameter error.
UnsupportedOperation The operation is not supported.
UnsupportedOperation.BIError Default business exception.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback