CreateTicket4Copilot

更新时间:
复制 MD 格式

Generates a ticket to embed Copilot.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

quickbi-public:CreateTicket4Copilot

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

CopilotId

string

Yes

The ID of the embedded Copilot module.

ccd3428c-dd23-460c-a608-26bae29dffee

TicketNum

integer

No

The number of times the ticket can be used. The value can range from 1 to 99,999.

  • Default: 1.

  • Recommended: 1.

  • Maximum: 99,999.

Each access decrements the ticket's usage count by one.

1

UserId

string

No

The ID of the Quick BI user. This is not your Alibaba Cloud account ID. Call the QueryUserInfoByAccount operation to obtain the user ID. Example: fe67f61a35a94b7da1a34ba174a7****.

Important Note: Specify either UserId or AccountName. If you leave both parameters empty, the ticket is bound to the API caller by default. Access is then granted based on the caller's identity.

9c-asdawf-casxcasd-asdasd

AccountName

string

No

The name of the user account.

Important Note: Specify either UserId or AccountName. If you leave both parameters empty, the ticket is bound to the API caller by default. Access is then granted based on the caller's identity.

测试用户

AccountType

integer

No

The type of the user account:

  • 1: Alibaba Cloud account

  • 3: Quick BI user

  • 4: DingTalk

  • 5: RAM user

  • 6: Third-party account (an account integrated using protocols such as SAML or OAuth)

  • 9: WeCom

  • 10: Lark

Important Note: This parameter is required if you specify AccountName.

1

ExpireTime

integer

No

The expiration time of the ticket.

  • Unit: minutes. The maximum validity period is 240 minutes (4 hours).

  • Default: 240 minutes.

200

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

D787E1A3-A93C-424A-B626-C2B05DF8D885

Result

string

The generated ticket.

f5eeb52e-d9c2-4a8b-80e3-47ab55c2****

Success

boolean

Indicates whether the request was successful. Valid values:

  • true: The request was successful.

  • false: The request failed.

true

Examples

Success response

JSON format

{
  "RequestId": "D787E1A3-A93C-424A-B626-C2B05DF8D885",
  "Result": "f5eeb52e-d9c2-4a8b-80e3-47ab55c2****",
  "Success": true
}

Error codes

HTTP status code

Error code

Error message

Description

400 CopilotEmbed.Config.NotFind Can not find copilot embed config with this copilot ID. Cannot find this embedded configuration
400 Authorize3rdTicket.Num.HasNoLeft There is no ticket number left, please generate new ticket.
400 Invalid.Param.Error The parameter is invalid. The parameter is invalid.
400 Authorize3rdTicket.Num.Exceed The number of tickets %s is invalid.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.