CreateEmbedToken接口用于生成报表嵌入需要使用的token。
说明 :如果token已经存在,则自动续期。
                     
                  请求参数
| 名称 | 类型 | 是否必选 | 示例值 | 描述 | 
|---|---|---|---|---|
| Action | String | 是 | CreateEmbedToken | 
                               要执行的操作。取值:CreateEmbedToken。  | 
                           
                        
| UserId | String | 否 | 46e537466****92704c8 | 
                               QuickBI的用户ID。 
  | 
                           
                        
| AccountName | String | 否 | 测试用户 | 
                               用户的账号名称。 
  | 
                           
                        
| AccountType | Integer | 否 | 1 | 
                               用户的账号类型。(注意:若accountName不为空,则accountType不能为空) 
  | 
                           
                        
| WorksId | String | 是 | a206f5f3-****-e9b17c835b03 | 
                               报表ID。  | 
                           
                        
| ExpireMin | Integer | 否 | 100 | 
                               过期时间。 
  | 
                           
                        
返回数据
| 名称 | 类型 | 示例值 | 描述 | 
|---|---|---|---|
| RequestId | String | 983007EB-9E72-0962-9BA3-31B318649697 | 
                               请求ID。  | 
                           
                        
| Result | Object | 
                               返回嵌入token的相关信息。  | 
                           
                        |
| AccessToken | String | a1b4****511746f7ce33e8b8f | 
                               token编码。  | 
                           
                        
| TokeType | Long | 4 | 
                               报表嵌入的token类型。统一为4,不可更改。  | 
                           
                        
| InvalidTime | String | 2021-09-15 07:18:25 | 
                               token过期时间。  | 
                           
                        
| RegisterTime | String | 2021-09-10 18:38:18 | 
                               token注册时间。  | 
                           
                        
| Success | Boolean | true | 
                               是否请求成功。取值范围: 
  | 
                           
                        
示例
请求示例
http(s)://quickbi-public.aliyuncs.com/?Action=CreateEmbedToken
&UserId=46e537466****92704c8
&AccountName=测试用户
&AccountType=1
&WorksId=a206f5f3-****-e9b17c835b03
&ExpireMin=100
&公共请求参数
                  正常返回示例
XML格式
                  
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateEmbedTokenResponse>
    <RequestId>983007EB-9E72-0962-9BA3-31B318649697</RequestId>
    <Result>
        <AccessToken>a1b4****511746f7ce33e8b8f</AccessToken>
        <TokeType>4</TokeType>
        <InvalidTime>2021-09-15 07:18:25</InvalidTime>
        <RegisterTime>2021-09-10 18:38:18</RegisterTime>
    </Result>
    <Success>true</Success>
</CreateEmbedTokenResponse>
                  JSON格式
                  
HTTP/1.1 200 OK
Content-Type:application/json
{
  "RequestId" : "983007EB-9E72-0962-9BA3-31B318649697",
  "Result" : {
    "AccessToken" : "a1b4****511746f7ce33e8b8f",
    "TokeType" : 4,
    "InvalidTime" : "2021-09-15 07:18:25",
    "RegisterTime" : "2021-09-10 18:38:18"
  },
  "Success" : true
}
                  错误码
| HttpCode | 错误码 | 错误信息 | 描述 | 
|---|---|---|---|
| 500 | Internal.System.Error | An internal system error occurred. | 系统内部异常。 | 
| 500 | Invalid.Parameter.Error | The parameter is invalid:%s. | 无效参数%s。 | 
| 500 | User.Not.In.Organization | The specified user is not in the organizational unit. | 该用户不在组织中。 | 
| 500 | Authorize3Rd.Token.ToMuch | There are too many valid tokens [%s]. Please do not apply for the same tokens again. | 该用户改报表已经创建太多token [%s], 请勿重复申请。 | 
| 500 | DirtyData.Duplicate.User | Dirty data,duplicate user: %s. | 脏数据,重复的用户:%s。 | 
| 500 | Report.NotExist | The dashboard does not exist. | 当前仪表板不存在。 | 
| 500 | Report.NotExist.Error | This work does not exist. It may have been deleted. Work ID is %s. | 作品不存在,可能已经被删除。作品ID:%s。 | 
| 500 | Access.ReportTree.Unauthorized | The access report tree is not authorized. | 访问报表未开通嵌入。 | 
| 500 | Cube.Not.Exist | The Cube does not exist. | 数据集不存在。 | 
| 500 | Datasource.Not.Found | The specified data source is not found. | 未找到数据源 | 
| 500 | Organization.Workspace.Inconformity | The workspace does not match the organization. | 工作空间与组织不一致。 | 
| 500 | ApiUser.Not.Exists | The specified user does not exist. | 用户不存在。 | 
| 500 | System.Param.Empty | You must specify the %s parameter. | 参数%s不能为空。 | 
访问错误中心查看更多错误码。